This site contains OpenCL notes, tutorials, benchmarks, news.

Wednesday, April 10, 2013

OpenCL and Blender (Cycles)

It seems that OpenCL is not so important for Blender community (Blender 2.66a). Cycles engine works quite nice with CUDA but when you try to turn on the OpenCL support you need at first to set CYCLES_OPENCL_TEST environment variable. When done you might think that everything will work as it should, but it doesn't. When trying to render something I got next compile errors:

"/tmp/OCLpiZAxQ.cl", line 27089: error: expected a ")"

        int shader, int object, int prim, float u, float v, float t, float time, int segment = ~0)

                                                                                             ^

"/tmp/OCLpiZAxQ.cl", line 27226: error: too few arguments in function call

        shader_setup_from_sample(kg, sd, P, Ng, I, shader, object, prim, u, v, 0.0f, TIME_INVALID);

                                                                                                 ^

"/tmp/OCLpiZAxQ.cl", line 28436: error: too few arguments in function call

                        shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v, t, time);


They are saying at  http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/OpenCL that drivers for OpenCL are not mature enough. But according   http://www.luxrender.net/luxmark/ this is not the case. They have quite stable OpenCL renderer which can even work in GPU+CPU mode.

The problem I see with Cycles renderer is that they use to big kernel. This is no go for GPU computing in basic concept. Why? Register pressure is not equal all accross the kernel (yes I know, you can save registers to global memory too). Some sections of kernel can be executed suboptimally. Such problems might be partly solved with Dynamic parallelism but what about backward compatibility? And please don't forget that GPUs rock at SIMD (SIMT) paradigm. And should we use GPU registers more for arithmetic raw power or rather to make development easier?



2 comments:

  1. Please post this in the blender forums, multiple places if necessary.

    Their continued usage of big kernel and mild stupidity surround opencl has been pissing me off for a long while now, to say the least.

    According to the blender devs, splitting the kernel will take 'considerable time'. Once again, everyone is pretending 'opencl is hard'...Makes you wonder why they didn't make the OPEN solution highest priority. Apparently now that apple is including firepros exclusively in their new 'pro' (hehe, apple sure does like their little jokes....'pro'...besides those firepros, you would have to pay me to use apple hardware or software), they have a little fire lit under their ass. Something to do with 'Connections', according to apple and blender, which is of course bullshit. They just aren't spending all their time playing with effing cuda-based child's implementations all the time now.

    ReplyDelete
  2. replica rolex watches, combining elegant style and cutting-edge technology, a variety of styles of replica rolex air king watches, the pointer walks between your exclusive taste style.

    ReplyDelete