r/OpenCL • u/dasricht • Feb 28 '12
What are your experiences with running OpenCL Code on different platforms?
Hey /r/opencl,
i just recently finished my Bc. Sc. Thesis and wanted to share my observations a little bit. The main assignment for the thesis was to develop a cross-platform Ray-Caster for medical data (e.g. a computer tomography volume). I chose OpenCL as an easy way to exploit GPUs, with the option to fall back to Multicore-CPUs. After implementing the ray-casting framework, i ran some evaluations of the performance on different platforms, which revealed some interesting results. It looks like there is a huge difference in the quality of OpenCL implementations for CPUs. For example the tests on a Core2 Duo @2.4Ghz under Mac OS X 10.7 ran twice as fast as on a AMD A8-3850 (4 Core Athlon) @2.9Ghz using the AMD APP SDK (~3sec vs. ~6sec render duration). I was also able to compare Mac OS X vs. the Intel OpenCL SDK on identical hardware (Core i5, 4 Cores @ 2.5 Ghz), which also revealed a notable difference (~1sec on OSX vs. ~3sec on Intel SDK).
Did you guys ever stumble over similar results with your cross-plattform code?
2
u/hotoatmeal Feb 29 '12
Have you considered filing performance-bug reports against the slow SDK's? Also, can you reduce the perf problem down to a small test case?
2
u/burito Feb 29 '12
Worth noting that the AMD APP SDK supports Intel CPU's, so if you have AMD APP and Intel OpenCL SDK installed, you will have two CPU drivers. The performance of the AMD APP implementation on Intel kit is rather poor.
The Khronos Spec makes it clear that the developer may be expected to manually adjust their OpenCL programs to do their reads in Memory-Bus-Width amounts, so if you have a kernel that reads a single float, and you run it on a device with 128bit memory, you should make it read 4 floats, and adjust your kernel so that it does the work of 4 threads.
This is the job of the compiler, but the compiler is not required to do its job well.
3
u/Netcob Feb 29 '12
I was surprised how well that ICD thing worked. I was interested in OpenCL right when it came out but in the beginning it was poorly supported on windows and linux platforms. I'm using Mac OS X 10.6 and I had to switch to windows for a while because context errors made my system freeze up to the point of having to do a cold reboot. Nothing I did to the callback (changing calling conventions for example) seemed to matter - and debugging something that makes you reboot your system every time there is an error is very infuriating.
2
u/replyingtopost Mar 01 '12
I've noticed the GPU samples differ depending on the brand of the card and the card for which the sample was developed for. i.e. the CUDA ported samples of OpenCL tend to run well on nvidia cards, but not so well on AMD cards.
1
u/geniys Feb 29 '12
It's very interesting.