Talk about GPU computing with CUDA and OpenCL
In March 2017 I gave a talk about GPU computing with CUDA and OpenCL at the para//el 2017 conference in Heidelberg, Germany.
March 03, 2015
A ray tracer is a good choice, because
The following table shows the implemented variants (as of 2011)
| Language | Framework | CPU/GPU | Cores/SMs/Threads |
|---|---|---|---|
| C++ | sequential | CPU | 1 core = 1 thread |
| C++ | POSIX threads (pthreads) | CPU | 4 cores * 2 hyperthread = 8 threads |
| C++ | OpenMP | CPU | 4 cores * 2 hyperthread = 8 threads |
| C++ | NVIDIA CUDA | GPU | 16 SM = 512 cores = 512 threads |
| C++ | Cell processor | CPU | 6 SPUs |
| Java | sequential | CPU | 1 |
| Java 7 | ForkJoinPool |
CPU | 4 cores * 2 hyperthread = 8 threads |
I started in 2009 with the PS3. The cell broadband engine is a multi-core processor. One of the cores, the so called PPE, is a general processor that can handle I/O, memory, etc. And there are 6 so called SPEs that are spezialized to number crunching. All the cores are 128-bit SIMD vector processors.
There are two ways to parallelize.
I implemented the first part. The following film shows the ray tracer in action. I started with 1 SPE and incrementally increased the number until the maximal allowed 6 SPEs.
As a second example i ported the ray tracer to the Mac and the PC. I used the pthreads library. The following vide shows an Intel Core 2 Duo with 2.2 MHz (a laptop processor of 2009).
And here on an Intel Core i7 920 with 2.67 MHz.
The port to the CUDA framework was relatively easy. And: it was worth it. Because GPUs are much faster. An NVIDA 580 achieves 650 FPS for 640x480 pixels and 98 FPS for 1920x1148 pixels (in the video the FPSs are lower, because the camera app took processor performance).
An NVIDA 285 achieved 250 FPS for 640x480 pixels and 57 FPS for 1920x1030 pixels.
Since then i made further tests with newer GPUs.
With OpenMP.
In Java 7 there is the new class ForkJoinPool, that is used in the following example.
I created a playlist on youtube, that contains all the videos above.
In March 2017 I gave a talk about GPU computing with CUDA and OpenCL at the para//el 2017 conference in Heidelberg, Germany.
CUDA 8.0 on Mac OS X 10.12 gave me the following error: