Assertion failed on OpenCL rendering #53830

Closed
opened 2018-01-18 19:44:30 +01:00 by Arto Kitula · 6 comments

macOS 10.12.6
AMD Radeon R9 M370X 2048 MB

Blender master, hash 42a562496b

GPU OpenCL compute render default cube scene ->

I0118 20:43:47.349573 229617664 util_system.cpp:77] Detected 1 CPU groups.
I0118 20:43:47.349611 229617664 util_system.cpp:80] Group 0 has 8 threads.
I0118 20:43:47.349617 229617664 util_task.cpp:203] Creating pool of 8 threads.
I0118 20:43:47.349787 229617664 device_opencl.cpp:41] Using mega kernel.
I0118 20:43:47.349866 229617664 opencl_base.cpp:99] Creating new Cycles device for OpenCL platform Apple, device AMD Radeon R9 M370X Compute Engine.
Assertion failed: (alignment < 1024), function MEM_lockfree_mallocN_aligned, file /Users/azo/Code/blender/blender-build/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c, line 366.
macOS 10.12.6 AMD Radeon R9 M370X 2048 MB Blender master, hash 42a562496b5 GPU OpenCL compute render default cube scene -> ``` I0118 20:43:47.349573 229617664 util_system.cpp:77] Detected 1 CPU groups. I0118 20:43:47.349611 229617664 util_system.cpp:80] Group 0 has 8 threads. I0118 20:43:47.349617 229617664 util_task.cpp:203] Creating pool of 8 threads. I0118 20:43:47.349787 229617664 device_opencl.cpp:41] Using mega kernel. I0118 20:43:47.349866 229617664 opencl_base.cpp:99] Creating new Cycles device for OpenCL platform Apple, device AMD Radeon R9 M370X Compute Engine. Assertion failed: (alignment < 1024), function MEM_lockfree_mallocN_aligned, file /Users/azo/Code/blender/blender-build/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c, line 366. ```
Author

Added subscriber: @ArtoKitula

Added subscriber: @ArtoKitula
Brecht Van Lommel was assigned by Arto Kitula 2018-01-18 19:45:06 +01:00

This issue was referenced by blender/cycles@eff8353a44

This issue was referenced by blender/cycles@eff8353a442f37737e4f8c916ef84b27a5c3ac2d

This issue was referenced by 0fe41009f0

This issue was referenced by 0fe41009f095835bda961a67697b36cbc8cade49

Can you test if this helps? I don't have a Mac with AMD card.

diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 459d512172f..47d099a1f94 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -1137,14 +1137,14 @@ bool OpenCLInfo::get_driver_version(cl_device_id device_id,

 int OpenCLInfo::mem_address_alignment(cl_device_id device_id)
 {
-       int base_align_bits;
+       int base_align_bytes;
        if(clGetDeviceInfo(device_id,
-                          CL_DEVICE_MEM_BASE_ADDR_ALIGN,
+                          CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE,
                           sizeof(int),
-                          &base_align_bits,
+                          &base_align_bytes,
                           NULL) == CL_SUCCESS)
        {
-               return base_align_bits/8;
+               return base_align_bytes;
        }
        return 1;
 }

Aligning to a very high value is likely harmless, but no good reason to do it. Alternatively we could just bump that 1024 in the assert a bit higher, but would need to know the value you were getting then.

Can you test if this helps? I don't have a Mac with AMD card. ``` diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index 459d512172f..47d099a1f94 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -1137,14 +1137,14 @@ bool OpenCLInfo::get_driver_version(cl_device_id device_id, int OpenCLInfo::mem_address_alignment(cl_device_id device_id) { - int base_align_bits; + int base_align_bytes; if(clGetDeviceInfo(device_id, - CL_DEVICE_MEM_BASE_ADDR_ALIGN, + CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, sizeof(int), - &base_align_bits, + &base_align_bytes, NULL) == CL_SUCCESS) { - return base_align_bits/8; + return base_align_bytes; } return 1; } ``` Aligning to a very high value is likely harmless, but no good reason to do it. Alternatively we could just bump that 1024 in the assert a bit higher, but would need to know the value you were getting then.
Author

Didn't work, now giving:

Assertion failed: (alignment == 16), function aligned_malloc, file /Users/azo/Code/blender/blender-build/blender/intern/guardedalloc/intern/mallocn.c, line 77.
Didn't work, now giving: ``` Assertion failed: (alignment == 16), function aligned_malloc, file /Users/azo/Code/blender/blender-build/blender/intern/guardedalloc/intern/mallocn.c, line 77. ```

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
Interest: X11
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
3 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#53830
No description provided.