Current Status

For supporting OpenCL, or hardware level GeneralPurposeGPU computing. We are at the planning stage, and redesigning the interfaces in gallium to support compute, like TGSI. It is expected that we will support AMD (ATI) Evergreen (r800 - HD5xxx), and hopefully Nvidia cards too.

cpu (llvmpipe) nv50 nvc0 r700 Evergreen/NI Cayman SI
gallium hw interface N/N MOSTLY MOSTLY 3D MOSTLY MOSTLY MOSTLY
handling GPU buffers TODO TODO TODO TODO DONE DONE DONE
execute TGSI compute shader TODO TODO TODO TODO N/A N/A N/A
execute LLVM-IR compute shader TODO TODO TODO TODO DONE DONE DONE
performance profiling TODO TODO TODO TODO TODO TODO TODO
global address space TODO TODO TODO TODO DONE DONE DONE
local address space TODO TODO TODO TODO TODO TODO TODO
private address space TODO TODO TODO TODO WIP WIP TODO
constant adress space TODO TODO TODO TODO WIP WIP TODO
local sync TODO TODO TODO TODO TODO TODO TODO
global sync TODO TODO TODO N/A TODO TODO TODO
local atomics TODO TODO TODO N/A TODO TODO TODO
global atomics TODO TODO TODO N/A TODO TODO TODO
2D image read TODO TODO TODO TODO TODO TODO TODO
3D image read TODO TODO TODO N/A TODO TODO TODO
2D image write TODO TODO TODO TODO TODO TODO TODO
3D image write TODO TODO TODO N/A TODO TODO TODO
accurate4 arithmetics TODO TODO TODO TODO MOSTLY7 WIP WIP
OpenCL5 1.0 TODO TODO TODO N/A6 WIP WIP WIP
OpenCL 1.1 TODO TODO TODO N/A WIP WIP WIP
OpenGL interoperability TODO TODO TODO TODO TODO TODO TODO

1 Proof of concept test code for testing and experimenting with hardware compute support

2 Hardware specific binary code

4 OpenCL defines some level expected accuracy. Some hardware doesn't support it, so we need software emulation

5 OpenCL front-end is a separate project, we aim to support all features needed by the front-end to implement the standard

6 Only partial OpenCL support is possible, support through vertex shaders.

7 Mostly reliable for float and integer types. char, short, long, and double types need more testing.

r600g

Supported Hardware

Supported Linux Kernel Versions

  • r600g compute is known to work with stable Linux Kernel versions >= 3.1. Versions older than 3.1 may work, but have not been tested.

How to Install

Getting the source code
  • Current Development version:

    • LLVM / Clang:

        git clone http://llvm.org/git/llvm.git
        cd llvm/tools
        git clone http://llvm.org/git/clang.git
      
    • libclc:

        git clone git://people.freedesktop.org/~tstellar/libclc
      
    • Mesa:

        git clone git://anongit.freedesktop.org/mesa/mesa
      
  • Stable Version (NOTE: Some distros provide packages for the stable versions of Mesa (9.1) and LLVM (3.2) that include compute support for r600g):

    • LLVM / Clang:

        git clone git://people.freedesktop.org/~tstellar/llvm
        cd llvm/tools
        wget http://llvm.org/releases/3.2/clang-3.2.src.tar.gz
        tar -xzf clang-3.2.src.targ.gz
        mv clang-3.2-src clang
      
    • libclc:

        git clone git://people.freedesktop.org/~tstellar/libclc
        git checkout llvm-3.2
      
    • Mesa:

        wget ftp://ftp.freedesktop.org/pub/mesa/9.1.1/MesaLib-9.1.1.tar.gz
        tar -xzf MesaLib-9.1.1.tar.gz
      
Building
  1. LLVM / Clang:

     cd llvm/
     ./configure --enable-experimental-targets=R600 --enable-targets=x86 --enable-shared
     make -j3 && make install
    
    • LLVM builds all supported targets by default, so adding --enable-targets=x86 will speed up the build time. NOTE: Mesa requires the X86 target to be built.
    • LLVM will try to use clang as its compiler by default. This may not work for you in all cases (e.g. you have an old version of clang installed). You can force llvm to use gcc by appending CC=gcc CXX=g++ to the configure arguments.
  2. libclc:

     git clone git://people.freedesktop.org/~tstellar/libclc
     cd libclc/
     ./configure.py
     make
     make install
    
    • When buiding libclc you may see this warning: is not a recognized processor for this target (ignoring processor) Don't worry, this warning is harmless.
  3. Mesa:

     cd mesa/
     ./autogen.sh --with-dri-drivers="" --with-gallium-drivers=r600 --enable-opencl
     make -j3
     make install
    

Testing

  • OpenCL examples that mostly work with clover and r600g can be found here.
  • Piglit: Use the all_cl.tests test profile.

Troubleshooting

  • If see this error message: radeon: Failed to get PCI ID, error number -13, make sure you have permissions to access the device (usually /dev/dri/card0), and get the latest version of mesa from git. Prior to this commit: 044de40cb0c6af54d99252f55145972780362afa, you would have seen this error message when running compute programs and X at the same time.
  • If you get the error message "cannot find stddef.h" when you try to run a compute program, this means that clang can't find its builtin include files. The solution for this is to make sure that clang and llvm are both installed to the same $(LIBDIR). Clover expects the clang builtin includes to be in $(LLVM_LIBDIR)/clang/$(LLVM_VERSION)/

Todo

R600ToDo#Compute