Kernel compile errors on Mesa OpenCL in 2.76 rc3 #46409

Closed
opened 2015-10-07 23:32:48 +02:00 by Vitaliy Filippov · 11 comments

Hi! I've tried to run Blender with Mesa OpenCL on a Radeon again and it still does not work :)

The kernel compile process first outputs the following error:

input.cl:2476:12: error: used type 'float' where floating point type is not allowed
...

This is caused by safe_normalize() where ((t) ? a/t : a) should be changed to ((t>0) ? a/t : a).

After fixing this problem, the output becomes:

input.cl:151:9: warning: 'NULL' macro redefined
/usr/include/clc/clctypes.h:89:9: note: previous definition is here
input.cl:21228:2: warning: implicit declaration of function 'vstore_half4' is invalid in C99
input.cl:726:40: note: expanded from macro 'float4_store_half'
input.cl:21868:62: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:105:43: note: expanded from macro 'make_float4'
input.cl:21873:63: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:105:43: note: expanded from macro 'make_float4'
input.cl:22061:14: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:22095:14: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:22112:14: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:22127:14: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:47612:15: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:47795:21: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:47878:21: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:49055:52: warning: implicit declaration of function 'native_tan' is invalid in C99
input.cl:133:17: note: expanded from macro 'tanf'
input.cl:121:32: note: expanded from macro 'atanf'
input.cl:49084:10: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:51727:25: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:52138:58: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:55237:32: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
input.cl:57639:12: warning: double precision constant requires cl_khr_fp64, casting to single precision
input.cl:1982:26: note: expanded from macro 'M_2PI_F'
unsupported initializer for address space in kernel_ocl_bake

If I comment out the line with kernel_bake_evaluate() call that error goes away O_o so the problem lies somewhere in that call... I think it's strange that only this kernel function fails to compile and others do not O_o. Also with that line removed there's another error:

unsupported call to function vstore_half4 in kernel_ocl_convert_to_half_float

It seems half floats (cl_khr_fp16 extension) are listed as optional in OpenCL specification, can you provide a way to use Blender without them?

Hi! I've tried to run Blender with Mesa OpenCL on a Radeon again and it still does not work :) The kernel compile process first outputs the following error: input.cl:2476:12: error: used type 'float' where floating point type is not allowed ... This is caused by safe_normalize() where ((t) ? a/t : a) should be changed to ((t>0) ? a/t : a). After fixing this problem, the output becomes: input.cl:151:9: warning: 'NULL' macro redefined /usr/include/clc/clctypes.h:89:9: note: previous definition is here input.cl:21228:2: warning: implicit declaration of function 'vstore_half4' is invalid in C99 input.cl:726:40: note: expanded from macro 'float4_store_half' input.cl:21868:62: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:105:43: note: expanded from macro 'make_float4' input.cl:21873:63: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:105:43: note: expanded from macro 'make_float4' input.cl:22061:14: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:22095:14: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:22112:14: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:22127:14: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:47612:15: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:47795:21: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:47878:21: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:49055:52: warning: implicit declaration of function 'native_tan' is invalid in C99 input.cl:133:17: note: expanded from macro 'tanf' input.cl:121:32: note: expanded from macro 'atanf' input.cl:49084:10: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:51727:25: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:52138:58: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:55237:32: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' input.cl:57639:12: warning: double precision constant requires cl_khr_fp64, casting to single precision input.cl:1982:26: note: expanded from macro 'M_2PI_F' unsupported initializer for address space in kernel_ocl_bake If I comment out the line with kernel_bake_evaluate() call that error goes away O_o so the problem lies somewhere in that call... I think it's strange that only this kernel function fails to compile and others do not O_o. Also with that line removed there's another error: unsupported call to function vstore_half4 in kernel_ocl_convert_to_half_float It seems half floats (cl_khr_fp16 extension) are listed as optional in OpenCL specification, can you provide a way to use Blender without them?

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @vitalif

Added subscriber: @vitalif
Member

Added subscribers: @Sergey, @Blendify

Added subscribers: @Sergey, @Blendify
Member
@Sergey

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2015-10-08 10:19:02 +02:00

Thanks for the report, but Gallium OpenCL support is far from complete (http://dri.freedesktop.org/wiki/GalliumCompute/), if you want to use OCL on your AMD GPU you need to use their (latest!) proprietary drivers - and even then, only latest architectures are supported afaik…

Thanks for the report, but Gallium OpenCL support is far from complete (http://dri.freedesktop.org/wiki/GalliumCompute/), if you want to use OCL on your AMD GPU you need to use their (latest!) proprietary drivers - and even then, only latest architectures are supported afaik…

I don't want to use proprietary drivers :) at least under Linux.

Can you at least fix the first bug ? (t>0) ?

And can you please tell what exactly Blender is missing from the Gallium OpenCL implementation? From the errors above I see that it's just half-precision floats (cl_khr_fp16). Is there something else?

I don't want to use proprietary drivers :) at least under Linux. Can you at least fix the first bug ? (t>0) ? And can you please tell what exactly Blender is missing from the Gallium OpenCL implementation? From the errors above I see that it's just half-precision floats (cl_khr_fp16). Is there something else?

It isn't a bug in the code, it's proper expression which could also happen in other areas of kernel. Blender requires full OpenCL 1.1 at least in order to function properly. For until it's officially supported in Mesa i don't really see reasoning trying to workaround issues caused by WIP nature of Mesa code.

It isn't a bug in the code, it's proper expression which could also happen in other areas of kernel. Blender requires full OpenCL 1.1 at least in order to function properly. For until it's officially supported in Mesa i don't really see reasoning trying to workaround issues caused by WIP nature of Mesa code.

Added subscriber: @ian_bruce

Added subscriber: @ian_bruce

For a more up-to-date discussion of this issue, see here:

https://developer.blender.org/T50522

short answer: it appears that GPU rendering with Mesa/openCL can now be made to work, if various Linux distributions will apply the known fixes for problems with libclc and LLVM, some of which are apparent above.

For a more up-to-date discussion of this issue, see here: https://developer.blender.org/T50522 short answer: it appears that GPU rendering with Mesa/openCL can now be made to work, if various Linux distributions will apply the known fixes for problems with libclc and LLVM, some of which are apparent above.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#46409
No description provided.