• Create Account

We're offering banner ads on our site from just \$5!

# OpenCL on Linux with Gallium3D

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

No replies to this topic

### #1Bacterius  Crossbones+   -  Reputation: 9101

Like
1Likes
Like

Posted 17 February 2013 - 04:40 PM

Hi,

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.

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

- Pessimal Algorithms and Simplexity Analysis