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
OpenCL run-time extension #574
Comments
I would love to have support for this, but I don't really know how opencl works, so help would be very much appreciated. |
As far as I can see the I contacted the maintainer of the Blender flatpak and asked him if and how he uses OpenCL. But I doubt it's enabled right now … |
Hello friends, today I started to play with flatpak, I must say that I am pretty impressed, they work really great, still having some rough edges such as OpenCL support or bumblebee support but overall impression is super :) As a Linux newbie I dont have much experience neither with OpenCL or flatpak, but as far as I know OpenCL uses something called ICD loaders. On all distributions they tend to be located in folder /etc/opencl/vendors Also Nvidia and Intel (Not sure how it works on AMD, but I guess that pretty similar) create a file libOpenCL.so.1 which always symlinks to their latest OpenCL driver (or library, not sure about the naming conventions :) ) There is a great article about how OpenCL works on Linux here: https://wiki.tiker.net/OpenCLHowTo I probably dont understand flatpaks enough to propose some specific solution but maybe flatpak could allow flatpak apps access to these files? To ICD loaders and libOpenCL symlinks? Do you think this could work? Just my two cents, hope it could spark some ideas :) |
Arch documentation also have some (hopefuly) useful information: https://wiki.archlinux.org/index.php/GPGPU "The OpenCL ICD loader is supposed to be a platform-agnostic library that provides the means to load device-specific drivers through the OpenCL API. Most OpenCL vendors provide their own implementation of an OpenCL ICD loader, and these should all work with the other vendors' OpenCL implementations. Unfortunately, most vendors do not provide completely up-to-date ICD loaders, and therefore Arch Linux has decided to provide this library from a separate project (ocl-icd) which currently provides a functioning implementation of the current OpenCL API." |
I read a little more about flatpak and how it handles GPU drivers and I think that it bundles them as runtimes. If I understand correctly Vulkan could work on flatpak and I think that it works similar to OpenCL, it is getting loaded with ICD loaders, maybe OpenCL could be implemented the same way? Make runtime provide OpenCL libs and ICD loaders to flatpak apps? |
Out of tree drivers (nvidia) is bundled as extensions, not runtimes. But it works similarly. As for the open source stack; that is not handled by Flatpak, but your distribution, as usual. |
That is handled by Flatpak too, just those can be bundled in the fdo runtime. |
Oh by bad, thank you for the correction. |
Basically what is missing is a symlink in the GL extension from /usr/lib/GL/nvidia-XXX-XX/lib/libnvidia-opencl.so to /usr/lib/GL/nvidia-XXX-XX/lib/libnvidia-opencl.so.XXX.XX and an OpenCL ICD file located in /etc/OpenCL/vendors/nvidia.icd containing the line "libnvidia-opencl.so" as text. |
@jbleonesio If you have the time you can add those here: https://github.com/flatpak/freedesktop-sdk-images/blob/nvidia-drivers/nvidia-apply-extra.c#L347-L375 Otherwise I'll try to remember to get around to it (or open an issue on that repo to track it). |
@TingPing I submitted 2 pull requests: one for OpenCL support in the SDK, the other one for shipping NVIDIA OpenCL ICD loader with the drivers. flatpak/freedesktop-sdk-images#78 I didn't manage to test it properly, so it will maybe need some corrections. |
Looking for the same, usecase: darktable flatpak; I have amdgpu opencl libraries installed (ubuntu 18.04), darktable installed by package can see them and works fine, darktable via package does not see them. ICD files in /etc/OpenCL/vendors amdocl64.icd |
Are there plans to allow applications talk to an OpenCL run-time similar to OpenGL? Applications like Darktable are almost useless without proper GPU acceleration.
The text was updated successfully, but these errors were encountered: