Jump to content
  • Advertisement
Sign in to follow this  

OpenCL on Linux with Gallium3D

This topic is 1919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


there seems to have been a lot of work lately on making the open-source Radeon driver (Gallium3D) OpenCL-enabled. This morning I decided to take a look, rebuilt MESA with the experimental patches and all. It claims to support OpenCL 1.1, and while it installed successfully, I still haven't gotten it to work. The provided examples did build and apparently ran, but crashed my graphics card due to kernel timeout.


The CL compiler itself (libclc) seems rather lacking and is missing a crapload of important utility stuff, such as sampler declarations, and rotate (bit rotation) which I use in my GPU PRNG. It is also very unforgiving when it comes to double literals, but that is probably pragmatic:



cl/prng.cl:17:42: warning: implicit declaration of function 'rotate' is invalid in C99
        block.lo += block.hi; block.hi = rotate(block.hi, (ulong2)(14, 16));

cl/noise.cl:15:10: warning: implicit declaration of function 'fmin' is invalid in C99
  return fmin( x - floor(x), 0x1.fffffep-1f );

./cl/main.cl:8:7: error: unknown type name 'sampler_t'
const sampler_t sampler = CLK_NORMALIZED_COORDS_TRUE |

./cl/main.cl:43:19: error: use of undeclared identifier 'INFINITY'
    float min_t = INFINITY;


Has anyone tried this before and got it working to some extent? I didn't expect the driver to work on my particular program since I require OpenCL 1.2 but the above indicates a very substantial part of the spec - essentially everything - is missing from the compiler (and possibly the driver). This shouldn't be the case, since blog posts indicate they managed to get Luxmark running under GPU acceleration. And the samples should definitely run, I will investigate that.


On the plus side, this experimental version has considerably better OpenGL support, which is always a plus. Now if I could get the power settings working before frying my card...


Thanks for any input!


PS: if you want to attempt this, be wary that this will overwrite any existing OpenCL runtimes you had before. I need to reinstall my CPU runtime since it mysteriously disappeared after reboot.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!