Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build PoCL with Vulkan and CUDA as backends #278

Open
VarLad opened this issue Jan 20, 2025 · 3 comments
Open

Build PoCL with Vulkan and CUDA as backends #278

VarLad opened this issue Jan 20, 2025 · 3 comments

Comments

@VarLad
Copy link
Contributor

VarLad commented Jan 20, 2025

Hello! Not sure if the issue should go here but, I was wondering if Vulkan and CUDA backends could be enabled in PoCL build options (concerning pocl_jll)

@maleadt
Copy link
Member

maleadt commented Jan 20, 2025

It's probably fine to track that here.

You can try and enable the build options in Yggdrasil, however, the problem is runtime dependency management. pocl_jll can't have to depend on CUDA_Runtime_jll (or the Intel/AMD equivalent) or it would be way to heavy to install. One option here is to split the built package into several JLLs, relying on pocl's loadable driver support, but that would probably require some changes in PoCL to support deferred driver loading (i.e. after libpocl.so has been loaded and initialized, because that's how the JLLs would behave). Alternatively, we could have several builds of PoCL, one for each target, but that feels suboptimal (and I don't know if we can have multiple copies of PoCL loaded at the same time).

Either way, I personally don't have the need / time for working on this. Feel free to take a stab, as long as it doesn't make the CPU use-case of PoCL significantly more complicated or large to install, I would be happy to have this feature.

@VarLad
Copy link
Contributor Author

VarLad commented Jan 22, 2025

The Vulkan request was inspired by the existence of https://dawn.googlesource.com/tint and https://github.com/gfx-rs/wgpu/tree/trunk/naga to take the compiled output (Vulkan) SPIR-V and use it to give KernelAbstractions a Web(as in wasm) backend. That won't be possible I guess, because PoCL on Vulkan doesn't support SVM or USM...
The idea itself comes from https://github.com/lights0123/hipscript/

For the CUDA backend, for now a separate pocl_cuda_jll makes sense. People would just do using OpenCL, pocl_cuda_jll if they want to use CUDA as a backend, as simple as that. Thats how the AUR packages it. This should work at least for now. We can change that when pocl allows deferred driver loading.
If no issues with this, I'll look into that.

@maleadt
Copy link
Member

maleadt commented Jan 22, 2025

Yeah, that's fine initially. You may want to wait until PoCL 6.1 is released, which requires some changes to the build script in Yggdrasil: JuliaPackaging/Yggdrasil#10317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants