Page MenuHome

Fails to compile OpenCL kernel on Mesa OpenCL in 2.72
Closed, ArchivedPublic

Description

Hi!
After the recent Tom Stellard's commit to LLVM StructurizeCFG, the Blender kernel does not crash Mesa's R600 shader compiler anymore.
So it seems it should be possible to compile Blender kernel under it.
But first it complains about line 803 in kernel_shader.h
sd->flag = bsdf_diffuse_setup(&sd->closure);
which should be
sd->flag = bsdf_diffuse_setup(sd->closure);
(it's probably another part of what I reported in T41912...)

And after correcting this problem it fails with "unsupported call to function fabsf in kernel_ocl_path_trace" - one fabsf() call gets into the IR nevertheless fabsf() is a macro... somewhere near exit from kernel_path_integrate()... It's very strange because the IR looks like fabsf(fabsf(v.x)+fabsf(v.y)+fabsf(v.z)) != 0 and the "outer" fabsf in this expression is not substituted... O_o.

Event Timeline

Vitaliy Filippov (vitalif) raised the priority of this task from to 90.
Vitaliy Filippov (vitalif) updated the task description. (Show Details)
Vitaliy Filippov (vitalif) edited a custom field.

The kernel compiles if I replace that fabsf with normal llvm.fabs.f32 in the IR manually...

Bastien Montagne (mont29) lowered the priority of this task from 90 to Low.Dec 6 2014, 12:18 AM

Ok, it seems fabsf is another bug of mesa opencl compiler.
But there is another problem, probably more fundamental:
You are using vstore_half4 which is missing in mesa...
As I understand it's about half-precision floats... is it really needed?

This bug appears in a custom build with after code changes, right? So this isn't something that should be reported in our tracker. @Bastien Montagne (mont29), I'll just remove BF Blender for now, guess thats okay?

Bastien Montagne (mont29) changed the task status from Unknown Status to Unknown Status.Dec 29 2014, 2:58 PM

Let's archive this, we cannot support incomplete OCL implementations anyway…

why do you say it's a custom build?! it's not a custom build, it's just 2.72 installed from debian repo.
please reopen it!

Our OpenCL support is experimental, and we could only test it with common OpenCL compilers from Nvidia, AMD and Intel. We can also only support official builds from blender.org. Blender from *any* third party repo is not official.

I think the problem is just the same in the official builds...
Maybe you'll at least give some comments on whether the vstore_half4 is really mandatory?