Mesa 9.0 introduces an opencl state tracker which is disabled by default (thus needing to be enabled by hand to work), there isn't any USE flag either to enable it. Reproducible: Always
I think it is a bit more complicated than just adding a USE flag. You will find an opencl enabled ebuild in the opencl branch of http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git
Beyond that, current OpenCL support in Mesa isn't actually useful for anything but small demos. That's not something I care about jumping through hoops to support in Gentoo.
Seems like llvm 3.2 will be required soon: http://lists.freedesktop.org/archives/mesa-dev/2012-October/028164.html So OpenCL support has probably be built from their llvm fork as described in http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install . I guess this makes it even more difficult to get ebuilds for a opencl useflag.
sys-devel/llvm-3.1-r2 and sys-devel/clang-3.1-r5 include patches to support r600 and are on the tree already (so llvm-3.2 isn't needed). I have added a snapshot based libclc and a mesa-9.0 ebuild with the opencl use flag to my overlay at http://git.overlays.gentoo.org/gitweb/?p=user/klondike.git;a=summary I have tried them on my redwood card with the tests provided at git://people.freedesktop.org/~tstellar/opencl-example and got 67 passes and 4 fails. It's not the best but is something. Anyway keep this in mind if you use this ebuilds you are on your own. Chi-Thanh, Matt, feel free to use the ebuilds in my overlay if you want, I'd appreciate if you at least made them available on the opencl branch of the x11 overlay (you may also want to update libclc since some patches aren't needed anymore).
I have bugged Tom Stellard on the llvm-3.2 issue raised by EoD, he said he is working towards getting r600 support on llvm-3.2 although it may not happen and that well, mesa-9.0 has really experimental opencl support (that one I was expecting from Chí-Thanh and Matt's answers). Below is his mail just for the record: Hi Francisco, On Mon, 2012-10-29 at 14:12 +0100, Francisco Blas Izquierdo Riera (klondike) wrote: > Hi Tom, > > I have been pushing a little towards getting the small preliminary > support for opencl on mesa 9.0 available on Gentoo, the result is some > ebuilds which seem to run well the tests (except the rotate ones since > rotl.cl is missing). > OpenCl support for Mesa 9.0 is very very experimental. I'm not really sure it's worth packaging, because there isn't much it can do besides running those tests. There has been a lot of work done since the 9.0 branch was made, so support in Mesa 9.1 should be much better. > Currently our versions of clang and llvm include patches to support the > r600 target on the 3.1 versions, but with the near release of 3.2 I > couldn't help but realize support for r600 was removed from the tree by > you at http://llvm.org/viewvc/llvm-project?view=rev&revision=160303 so > I'm wondering whether you have plans on supporting the R600 target on > LLVM 3.2 or not. > There was a misunderstanding between me and the LLVM developers which lead to the R600 backend being committed and then reverted in a short period of time. I would really like to get the R600 backend in the main tree prior to the 3.2 release, and I am working with the LLVM developers to get it reviewed and upstreamed. In the mean time, I am maintaining my own LLVM tree with the R600 backend. This code can be fetched from the branches/R600 branch of the LLVM repository or from my personal llvm git repo: git fetch git://people.freedesktop.org/~tstellar/llvm master To build with the R600 backend, you will need to build LLVM with --enable-experimental-targets=AMDGPU You can find the full build instructions here: http://dri.freedesktop.org/wiki/GalliumCompute We will be deprecating the LLVM 3.1 version of the R600 backend that is distributed with Mesa in the near future, so using LLVM 3.2 is recommended. -Tom > Thanks in advance. > Klondike >
Here is an update to the current status from Tom Stellard: http://lists.freedesktop.org/archives/mesa-dev/2013-January/032205.html
Fixed in 9.2_pre20130619