How To Begin Using OpenCL With Radeon Gallium3D

Written by Michael Larabel in Radeon on 17 March 2012 at 02:56 PM EDT. 2 Comments
RADEON
Earlier this month I wrote about how you can sort of begin using OpenCL acceleration out of the Radeon Gallium3D driver, but in the short time since, the code has continued to advance and now here's a guide for trying out this GPGPU computing technology on the open-source Radeon Linux driver.

Tom Stellard, the AMD employee that's been working on LLVM and OpenCL support within their open-source driver stack for the past several months, has finally blogged about the OpenCL progress: Testing clover with r600g.

Stellard's Radeon OpenCL work builds upon the Clover Gallium3D state tracker that's now a few years old, the GSoC work done last summer, the Nouveau OpenCL EVoC work (as shown in that article, OpenCL is now working for open-source NVIDIA), and this work continues to rely upon LLVM/Clang. Another developer, Ádám Rák, also recently wrote an R600 Gallium3D compute implementation.

This Radeon OpenCL support (for now at least) is being limited to Evergreen (Radeon HD 5000 series) and Northern Islands (Radeon HD 6000 series, but the HD 6900 Cayman GPUs aren't yet supported) and various out-of-tree bits.

On the DRM side, the Linux 3.1 kernel or newer will have you suited. For the Mesa/Gallium3D side, you currently need to use clover-r600-master from Tom Stellard's personal Mesa Git repository.

Additionally, the OpenCL 1.1 headers must be installed, the latest development LLVM/Clang snapshot needs to be used (from SVN/Git) and some patches applied there, and you also need to be using Tom's Git repository of libclc.

When all of the above factors are met, there should be basic OpenCL support in place for the HD 5000/6000 (non-Cayman) graphics processors. It will be interesting to check out to see how the OpenCL compute performance is on the open-source stack relative to AMD's Catalyst proprietary driver and its OpenCL implementation. As well, it will be interesting to see how the OpenCL support compares to that of Nouveau Gallium3D compute.

The next challenge will be to finally mainline all of this OpenCL work. Ideally we could see this happen for Mesa 8.1. This would be ideal to see since besides Mesa developers still being years behind with catching up to the latest OpenGL specifications, they're also years behind in the OpenCL support.

Aside from Mesa/Gallium3D itself, there will then need to be the release of LLVM/Clang 3.1 (likely to come in H2'2012) and a unified libclc. Hopefully all of this work will finally come together by year's end or ideally by the time of Ubuntu 12.10 / Fedora 17 (otherwise Ubuntu 13.04 / Fedora 18) so that Linux users can finally benefit from "out of the box" open-source OpenCL support. At that point, the OpenCL 1.0 specification will be four years old (it was ratified in December of 2008).
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week