I am trying to use OpenCl with the current mesa drivers as it is explained in this post from freedesktop: GalliumCompute, but when I try to install my own build of mesa with OpenCl it fails due to some conflicting files.
If we follow the post, we can see that we need:
- LLVM with '--enable-experimental-targets=R600', but the stable repo already provides this so we are fine.
- Libclc can be found in AUR: libclc-svn
- Mesa with '--enable-opencl'. This has to be built manually with ABS adding the flag to the PKGBUILD.
But when I try to install the generated packages I get an error because there are conflicting files:
error: failed to commit transaction (conflicting files) mesa: /usr/include/CL/cl.h exists in filesystem mesa: /usr/include/CL/cl.hpp exists in filesystem mesa: /usr/include/CL/cl_ext.h exists in filesystem mesa: /usr/include/CL/cl_gl.h exists in filesystem mesa: /usr/include/CL/cl_gl_ext.h exists in filesystem mesa: /usr/include/CL/cl_platform.h exists in filesystem mesa: /usr/include/CL/opencl.h exists in filesystem mesa: /usr/lib/libOpenCL.so exists in filesystem mesa: /usr/lib/libOpenCL.so.1 exists in filesystem mesa: /usr/lib/libOpenCL.so.1.0.0 exists in filesystem Errors occurred, no packages were upgraded.
Checking with 'pacman -Qo' I have found that the headers come from 'opencl-headers' and the shared objects from 'libcl'.
So, is there a way to install mesa with OpenCl support?
Thanks in advance.
Last edited by Noxbru (2013-09-30 16:13:18)
files in opencl-headers package :
usr/ usr/include/ usr/include/CL/ usr/include/CL/cl.h usr/include/CL/cl.hpp usr/include/CL/cl_ext.h usr/include/CL/cl_gl.h usr/include/CL/cl_gl_ext.h usr/include/CL/cl_platform.h usr/include/CL/opencl.h usr/share/ usr/share/licenses/ usr/share/licenses/opencl-headers/ usr/share/licenses/opencl-headers/LICENSE
the conflicting files in /usr/lib come from a different package, probably libcl .
looks to me as libclc might need to provide/conflict the opencl-headers & libcl packages.
You are aware that libclc currently only works on some ati video cards using the mesa radeon driver and libcl appears to be meant for nvidia cards ?
Sure, the files from /usr/lib come from libcl, at least that's what 'pacman -Qo' says.
You are aware that libclc currently only works on some ati video cards using the mesa radeon driver
Yes, I have asked the developer if my card would work, and supposedly it should, that's why I'm trying to build mesa with opencl support.
Libcl is installed in my system, from what I can see, as a dependency to imagemagick, which is also a dependency to some packages.
It's quite possible that you are wright, and in some way, mesa with opencl+libclc can substitute opencl-headers and libcl, thus the conflicts, but I don't know how to check if it is that.
I did some checking and imagemagick is built with --enable-opencl , which leads to libcl being a dependency .
Is your intention to use libclc opencl for specific programs , or as a general replacement for libcl ?
For the first case you could rebuild imagemagick and other programs using libcl through abs with --disable-opencl and remove the dependency on libcl / opencl-headers .
Then you can rebuild the specific programs you want to test with libclc against that.
In the second case, you should also rebuild the programs using libcl, but this time against libclc .
NOTE: Gallium Compute is still under heavy development, so the development version is recommended for best results
Whichever of those 2 you want, i strongly suggest using mesa, llvm and clang development versions.
You can save yourself some work by using Lordheavhy's unofficial mesa-git repo at http://pkgbuild.com/~lcarlier/mesa-git/ .
It builds mesa with opencl enabled, and llvm/clang/ libclc dev versions are also in that repo.
My intention was/is to try the OpenCl support that mesa has, and to try to learn OpenCl. That's why I was trying to build mesa with OpenCl support.
If I use Lordheavy's repo, I assume that first I will have to remove the libclc-svn package I have installed from AUR (as the one from this repo is libclc-git), add the repo, and upgrade? or trying to install mesa-git from this repo will automagically substitute it for the one I have?
the libclc-git package provides libclc, but libclc-svn doesn't.
So pacman has no way of knowing libclc-git and libclc-svn both provide libclc functionality, you'll have to remove libclc-svn manually.
1 more comment : if libclc-git and libcl install the same libOpenCL.so* files, chances are they are compatible and you may not have to rebuild opencl using programs like imagemagick.
Ok, I remove libclc-svn, it was needed to build mesa with opencl support.
But the libOpenCL.so* came from libcl, and I had the conflict when I tried to install my compiled version of mesa. So I think that maybe "my mesa" tries to install the headers and the libOpenCL.so* files, which in reality came from opencl-headers and libcl.
Another question: If I add Lordheavy's repo and try to install its mesa-git package, will pacman know that it has to substitute mesa with it, or should I uninstall it first?
Lordheavy's git packages are setup to make switching between mesa-git and mesa easy, so include provides/conflicts/replaces lines in the PKGBUILDs to ease substiution.
No need to uninstall mesa.
Mesa is a split package, and you should replace all parts of it.
If you run , there should be errors because all parts need to have been build against the same source,
but i don't know if pacman handles that correctly.
To be on the safe side, you should tell pacman to install ati-dri-git instead as that will pull the other necessary mesa-git subpackages.
about the files from opencl-headers & libcl :
mesa-git incudes opencl-mesa-git which does provide those files, but libclc-git doesn't have opencl-mesa-git as dependency.
I think the full command you should use is : .
That should pull in all needed pacakges and not give any conflicts.
The PKGBUILD for LH's mesa-git are in http://pkgbuild.com/~lcarlier/mesa-git/sources/ .
I looked directly into the sources to verify what i posted above.
Last edited by Lone_Wolf (2013-09-30 11:57:12)
I have just tried and... it works! I have OpenCL support with my card! Thanks a lot!!
The only issue is that now i can't watch flash videos accelerated by hardware, but I can live with that.
Thanks a lot again!!
Just a thank you to Lone_Wolf, your posts also helped me a lot