ATI released OpenCL SDK with hardware support

Discussions related to GPU Acceleration in LuxRender

Moderators: Dade, jromang, tomb, coordinators

Re: ATI released OpenCL SDK with hardware support

Postby Lord Crc » Mon Dec 07, 2009 5:06 pm

Try adding this to the end of SetUpOpenCL(), after the clCreateKernel call (and error handling):

Code: Select all
   // determine max work group size for this kernel
   for (i = 0; i < deviceListSize / sizeof(cl_device_id); ++i) {
      size_t gsize = 0;
      status = clGetKernelWorkGroupInfo(kernel,
            devices[i],
            CL_KERNEL_WORK_GROUP_SIZE,
            sizeof(size_t),
            &gsize,
            NULL);
      if (status != CL_SUCCESS) {
         fprintf(stderr, "Failed to get OpenCL device info: %d\n", status);
         exit(-1);
      }

      workGroupSize = (unsigned int)gsize;
      fprintf(stderr, "OpenCL Device %d: Max. kernel work group size = %d\n", i, workGroupSize);
   }


The max work group size that the device can handle doesn't have to be the same as the max it can handle for a given kernel. I suspect this is due to registry issues etc.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 5032
Joined: Sat Nov 17, 2007 2:10 pm

Re: ATI released OpenCL SDK with hardware support

Postby dougal2 » Mon Dec 07, 2009 5:26 pm

@LordCRC
Do you have a win32 binary I can try ?
User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

Re: ATI released OpenCL SDK with hardware support

Postby jensverwiebe » Mon Dec 07, 2009 5:44 pm

k

generally working now, but the performance of the 4 cpu-cores is much better than GPU am.
+ it eats lots of recources , so sys becomes unresponsive.

Needs some optimizing.
Jens
User avatar
jensverwiebe
Developer
 
Posts: 3429
Joined: Wed Apr 02, 2008 4:34 pm

Re: ATI released OpenCL SDK with hardware support

Postby Lord Crc » Mon Dec 07, 2009 5:56 pm

Here, includes both 32bit and 64bit versions. Not sure if you need any dlls or manifest, if so fetch the from my CVS builds of Luxrender.

I've made some further small changes, for instance it seems the opencl compiler preferred working with 4 component vectors even tho the last component isn't used.
Attachments
SmallptGPU.zip
(446.5 KiB) Downloaded 186 times
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 5032
Joined: Sat Nov 17, 2007 2:10 pm

Re: ATI released OpenCL SDK with hardware support

Postby dougal2 » Mon Dec 07, 2009 6:21 pm

Using driver 190.89, again I get epic fail
Code: Select all
C:\Documents and Settings\doug\Desktop\smallptgpu>SmallptGPU32.exe 0 1 1024 768 scenes\simple.scn
Usage: SmallptGPU32.exe
Usage: SmallptGPU32.exe <use CPU device (0 or 1)> <use GPU device (0 or 1)> <window width> <window height> <scene file>
Reading scene: scenes\simple.scn
Scene size: 5
Failed to open OpenCL context


(Win XP 32bit, GF 8800GT)
User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

Re: ATI released OpenCL SDK with hardware support

Postby Down Rodeo » Mon Dec 07, 2009 6:49 pm

After hours of swearing at Ubuntu, downgrading, updating, cursing some more, trawling forums and at one point completely destroying my drivers to the extent X would barely work, and even then all colour channels were mixed up, I have this working. The Mandelbrot test is pretty damned fantastic, though I wonder if I'm getting the right performance - admittedly I'm only on a laptop, but it's not bad. Not near current desktop standards but better than the majority of PCs out there, I reckon. I'll check the actual numbers against yours, though it will likely be lower anyway. I'll try the path tracer too :)
Down Rodeo
 
Posts: 145
Joined: Sun Nov 11, 2007 3:24 pm
Location: Scotland

Re: ATI released OpenCL SDK with hardware support

Postby Lord Crc » Mon Dec 07, 2009 7:00 pm

dougal2 wrote:Using driver 190.89, again I get epic fail


Hmm, this is compiled using ATI's Stream SDK beta, so perhaps thats the reason then. Though I assume with time that shouldn't matter.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 5032
Joined: Sat Nov 17, 2007 2:10 pm

Re: ATI released OpenCL SDK with hardware support

Postby Dade » Tue Dec 08, 2009 5:33 am

Down Rodeo wrote:After hours of swearing at Ubuntu, downgrading, updating, cursing some more, trawling forums and at one point completely destroying my drivers to the extent X would barely work, and even then all colour channels were mixed up, I have this working. The Mandelbrot test is pretty damned fantastic, though I wonder if I'm getting the right performance - admittedly I'm only on a laptop, but it's not bad. Not near current desktop standards but better than the majority of PCs out there, I reckon. I'll check the actual numbers against yours, though it will likely be lower anyway. I'll try the path tracer too :)


Hehe, all this stuff (SDK, drivers, etc.) is still very very experimental/alpha/beta. It is not hard find bugs in the support too (I think I already hit a couple of them). Anyway, the ATI SDK includes an nice utility named GLInfo, it prints a lot of information about the GPU, it can help to have an idea of the kind of performance you can expect.

I wrote a new version of MandelGPU kernel based on float4, it is able to compute 4 pixels at the same time and it is noticeably faster on ATI's GPUs (I have read NVIDIA doesn't have hardware support for this SSE-like vector types). I want to try if double extension is available too. I will upload the sources once I have finished.

Lord, you should try to use float4 for vectors (Vec type and macros), I bet it would be a lot faster :D
User avatar
Dade
Developer
 
Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: ATI released OpenCL SDK with hardware support

Postby Dade » Tue Dec 08, 2009 5:43 am

dougal2 wrote:Using driver 190.89, again I get epic fail
Code: Select all
C:\Documents and Settings\doug\Desktop\smallptgpu>SmallptGPU32.exe 0 1 1024 768 scenes\simple.scn
Usage: SmallptGPU32.exe
Usage: SmallptGPU32.exe <use CPU device (0 or 1)> <use GPU device (0 or 1)> <window width> <window height> <scene file>
Reading scene: scenes\simple.scn
Scene size: 5
Failed to open OpenCL context


(Win XP 32bit, GF 8800GT)


Doug, check this post: http://forum.beyond3d.com/showpost.php? ... tcount=313 It looks like you can run ATI's SDK compiled binaries but you need a "new" NVIDIA driver (beta 195.39 ?).
User avatar
Dade
Developer
 
Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: ATI released OpenCL SDK with hardware support

Postby dougal2 » Tue Dec 08, 2009 6:55 am

Slight improvement with 195.62

Code: Select all
C:\Documents and Settings\doug\Desktop\smallptgpu>SmallptGPU32.exe 0 1 1026 768 scenes\simple.scn
Usage: SmallptGPU32.exe
Usage: SmallptGPU32.exe <use CPU device (0 or 1)> <use GPU device (0 or 1)> <window width> <window height> <scene file>
Reading scene: scenes\simple.scn
Scene size: 5
OpenCL Device 0: Type = TYPE_GPU
OpenCL Device 0: Name = GeForce 8800 GT
OpenCL Device 0: Compute units = 14
OpenCL Device 0: Max. work group size = 512
Reading file 'rendering_kernel.cl' (size 2930 bytes)
Failed to build OpenCL kernel: 1
OpenCL Programm Build Log: <predefines>:2128: note: previous definition is here
#define clamp(X, Y, Z)  __builtin_overload(3, X, Y, Z,  \
        ^
<predefines>:1939: note: previous definition is here
#define max(X, Y) __builtin_overload(2, X, Y,       \
        ^
<predefines>:1955: note: previous definition is here
#define min(X, Y) __builtin_overload(2, X, Y,       \
        ^
:90: error: read-only variable is not assignable
        colors[i] = c;
        ~~~~~~~~~ ^
User avatar
dougal2
Developer
 
Posts: 3131
Joined: Mon Jan 14, 2008 7:21 am

PreviousNext

Return to GPU Acceleration

Who is online

Users browsing this forum: No registered users and 1 guest