summaryrefslogtreecommitdiff
path: root/GalliumCompute.mdwn
diff options
context:
space:
mode:
Diffstat (limited to 'GalliumCompute.mdwn')
-rw-r--r--GalliumCompute.mdwn130
1 files changed, 130 insertions, 0 deletions
diff --git a/GalliumCompute.mdwn b/GalliumCompute.mdwn
new file mode 100644
index 0000000..453b7a2
--- /dev/null
+++ b/GalliumCompute.mdwn
@@ -0,0 +1,130 @@
+
+[[!toc ]]
+
+
+## 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.
+[[!table header="no" class="mointable" data="""
+ | **cpu (llvmpipe)** | **nv50** | **nvc0** | **r700** | **r800** | **r900**
+non gallium test code<sup>1</sup> | N/N | TODO | TODO | DONE | DONE | WIP
+gallium hw interface | N/N | MOSTLY | MOSTLY | 3D | MOSTLY | MOSTLY
+execute binary<sup>2</sup> compute shader | TODO | TODO | TODO | N/A | MOSTLY | TODO
+handling GPU buffers | TODO | TODO | TODO | TODO | MOSTLY | MOSTLY
+execute TGSI compute shader | TODO | TODO | TODO | TODO | N/A | N/A
+execute LLVM-IR compute shader | TODO | TODO | TODO | TODO | DONE | DONE
+performance profiling | TODO | TODO | TODO | TODO | TODO | TODO
+global address space | TODO | TODO | TODO | TODO | DONE | WIP
+local address space | TODO | TODO | TODO | TODO | TODO | TODO
+private address space | TODO | TODO | TODO | TODO | WIP | WIP
+constant adress space | TODO | TODO | TODO | TODO | WIP | WIP
+local sync | TODO | TODO | TODO | TODO | TODO | TODO
+global sync | TODO | TODO | TODO | N/A | TODO | TODO
+local atomics | TODO | TODO | TODO | N/A | TODO | TODO
+global atomics | TODO | TODO | TODO | N/A | TODO | TODO
+2D image read | TODO | TODO | TODO | TODO | TODO | TODO
+3D image read | TODO | TODO | TODO | N/A | TODO | TODO
+2D image write | TODO | TODO | TODO | TODO | TODO | TODO
+3D image write | TODO | TODO | TODO | N/A | TODO | TODO
+accurate<sup>4</sup> arithmetics | TODO | TODO | TODO | TODO | MOSTLY<sup>7</sup> | WIP
+OpenCL<sup>5</sup> 1.0 | TODO | TODO | TODO | N/A<sup>6</sup> | WIP | WIP
+OpenCL 1.1 | TODO | TODO | TODO | N/A | WIP | WIP
+OpenGL interoperability | TODO | TODO | TODO | TODO | TODO | TODO
+"""]]
+
+<sup>1</sup> Proof of concept test code for testing and experimenting with hardware compute support
+
+<sup>2</sup> Hardware specific binary code
+
+<sup>4</sup> OpenCL defines some level expected accuracy. Some hardware doesn't support it, so we need software emulation
+
+<sup>5</sup> OpenCL front-end is a separate project, we aim to support all features needed by the front-end to implement the standard
+
+<sup>6</sup> Only partial OpenCL support is possible, support through vertex shaders.
+
+<sup>7</sup> Mostly reliable for float and integer types. char, short, long, and double types need more testing.
+
+
+### r600g
+
+
+#### Supported Hardware
+
+* All Evergreen and Northern Islands GPU familes are currently supported. If you are unsure what family your GPU is, you can use this chart: [[http://www.x.o/wiki/RadeonFeature#Decoder_ring_for_engineering_vs_marketing_names|http://www.x.org/wiki/RadeonFeature#Decoder_ring_for_engineering_vs_marketing_names]] to figure it out.
+* There are still a few bugs on Cayman GPUs, that may prevent some compute features from working as well as they do on pre-Cayman GPUS.
+
+#### 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: [[!format txt """
+git clone http://llvm.org/git/llvm.git
+cd llvm/tools
+git clone http://llvm.org/git/clang.git
+"""]]
+ * libclc: [[!format txt """
+git clone git://people.freedesktop.org/~tstellar/libclc
+"""]]
+ * Mesa: [[!format txt """
+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: [[!format txt """
+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: [[!format txt """
+git clone git://people.freedesktop.org/~tstellar/libclc
+git checkout llvm-3.2
+"""]]
+ * Mesa: [[!format txt """
+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: [[!format txt """
+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.
+1. libclc: [[!format txt """
+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.
+1. Mesa: [[!format txt """
+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|http://cgit.freedesktop.org/~tstellar/opencl-example/]].
+* [[Piglit|http://cgit.freedesktop.org/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|R600ToDo]]