Page MenuHome

Linux, 2.79b Cycles : Crash when GPU rendering (OpenCL) and using displacements
Closed, ResolvedPublic

Description

Issue:

Blender closes instantly after loading the render kernels during a render, or when activating the viewport rendering, if displacements are enabled and set to true or both (experimental features).

It works fine on Windows.

Steps to reproduce:
Install OpenCL from AMDGPU-PRO 18.40 or 18.30 on Ubuntu 18.04.1
In Blender, set renderer to Cycles
Add any mesh
Add any texture to it (noise, voronoi, magic...)
In node editor, connect Fac output to Displacements input
Enable GPU rendering and experimental features
Set displacements to true or both in settings, in the materials tab.
Render (F12 or viewport)

Crashes will not occur if displacements are set to bump.
A .blend file has been uploaded. Press F12 after opening it, or enable viewport rendering.
Video available here: https://youtu.be/DpGHtuE15fo

System information
AMD Ryzen 1600X
Vega 64
16GB RAM

Ubuntu 18.04, Linux 4.15.0-39
Using the opensource amdgpu driver and the OpenCL component of amdgpu-pro 18.40
Mesa 18.1.0-rc4
OpenGL 4.5
DRM 3.26.0 AMD 18.30
LLVM 6.0.1

blender --debug-gpu outputs:

Read prefs: /home/etienne/.config/blender/2.79/config/userpref.blend
Using KHR_debug extension
GL application marker: Successfully hooked OpenGL debug callback.
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 12 Code Size: 380 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 16 VGPRS: 16 Code Size: 44 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 8 Code Size: 88 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 16 VGPRS: 16 Code Size: 92 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 8 Code Size: 276 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 16 Code Size: 216 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 16 Code Size: 216 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 12 Code Size: 308 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 16 Code Size: 220 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 3 instructions in function
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 2 instructions in function
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 16 Code Size: 216 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 20 Code Size: 164 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 16 Code Size: 376 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 12 Code Size: 348 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 12 Code Size: 348 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 4 instructions in function
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 14 instructions in function
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 8 instructions in function
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 11 instructions in function
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 8 Code Size: 276 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 20 Code Size: 192 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 20 Code Size: 192 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 24 VGPRS: 16 Code Size: 184 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: Shader Stats: SGPRS: 16 VGPRS: 16 Code Size: 44 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 2 instructions in function
GL shader compiler other: Shader Stats: SGPRS: 32 VGPRS: 16 Code Size: 184 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
Read blend: /home/etienne/Documents/Blender/Projects/crash test.blend
GL shader compiler other: Shader Stats: SGPRS: 56 VGPRS: 16 Code Size: 1072 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 189 instructions in function
GL shader compiler other: Shader Stats: SGPRS: 56 VGPRS: 16 Code Size: 1100 LDS: 0 Scratch: 0 Max Waves: 10 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0
Device init success
GL shader compiler other: LLVM diagnostic (remark): <unknown>:0:0: 16 instructions in function
blender: /build/blender-UBljLx/blender-2.79.b+dfsg0/intern/cycles/device/opencl/opencl_base.cpp:504: virtual void ccl::OpenCLDeviceBase::tex_alloc(const char*, ccl::device_memory&, ccl::InterpolationType, ccl::ExtensionType): Assertion `mem_map.find(name) == mem_map.end()' failed.
Aborted (core dumped)

clinfo outputs:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (2686.5)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     gfx900
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 2.0 AMD-APP (2686.5)
  Driver Version                                  2686.5 (PAL,HSAIL)
  Device OpenCL C Version                         OpenCL C 2.0 
  Device Type                                     GPU
  Device Board Name (AMD)                         Radeon RX Vega
  Device Topology (AMD)                           PCI-E, 25:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               64
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             1630MHz
  Graphics IP (AMD)                               9.0
  Device Partition                                (core)
    Max number of sub-devices                     64
    Supported partition types                     None
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  Preferred work group size multiple              64
  Wavefront width (AMD)                           64
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             No
    Round to nearest                              No
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              8573157376 (7.984GiB)
  Global free memory (AMD)                        8372224 (7.984GiB)
  Global memory channels (AMD)                    64
  Global memory banks per channel (AMD)           4
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           4244635648 (3.953GiB)
  Unified memory for Host and Device              No
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       2048 bits (256 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Max size for global variable                    3820172032 (3.558GiB)
  Preferred total size of global vars             8573157376 (7.984GiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                64
    Max number of read/write image args           64
  Max number of pipe args                         16
  Max active pipe reservations                    16
  Max pipe packet size                            4244635648 (3.953GiB)
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Local memory syze per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max number of constant args                     8
  Max constant buffer size                        4244635648 (3.953GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                262144 (256KiB)
    Max size                                      8388608 (8MiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        1542219670678886735ns (Wed Nov 14 19:21:10 2018)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  Yes
    Number of async queues (AMD)                  8
    Max real-time compute queues (AMD)            0
    Max real-time compute units (AMD)             0
    SPIR versions                                 1.2
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                
  Device Extensions                               cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_khr_gl_depth_images cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_image2d_from_buffer cl_khr_spir cl_khr_subgroups cl_khr_gl_event cl_khr_depth_images cl_khr_mipmap_image cl_khr_mipmap_image_writes 

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx900
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx900
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx900

Details

Type
Bug

Event Timeline

Syd (sydd) triaged this task as Confirmed, High priority.
Syd (sydd) updated the task description. (Show Details)Nov 14 2018, 7:44 PM
Christopher Anderssarian (Christopher_Anderssarian) raised the priority of this task from Confirmed, High to Needs Triage by Developer.

Don't triage yourself.

BTW Couldn't reproduce with my Vega 64

Syd (sydd) added a comment.EditedNov 14 2018, 8:17 PM

Sorry, it's my first time posting. Are you using amdgpu-pro, or amdgpu and an opencl package from somewhere else?

Syd (sydd) updated the task description. (Show Details)Nov 14 2018, 8:17 PM
Syd (sydd) renamed this task from 2.79b Cycles : Crash when GPU rendering (OpenCL) and using displacements to Linux, 2.79b Cycles : Crash when GPU rendering (OpenCL) and using displacements.
Syd (sydd) updated the task description. (Show Details)Nov 14 2018, 8:41 PM

Are you using amdgpu-pro, or amdgpu and an opencl package from somewhere else?

No, sorry. I'm using Version 18.10.1 Adrenalin Edition for windows...

But AFAIK as long as the driver is official this will get investigated.

Yeah I just updated it, it works for me on windows too, but not on linux with their official driver. I'd like to see if a linux Vega user with amdgpu-pro can reproduce the issue.

Does the previous driver version crash, too?

Syd (sydd) added a comment.EditedNov 15 2018, 1:39 PM

The crash also happens with amdgpu-pro 18.30. I will try 18.20 tonight
Edit: amdgpu-pro 18.20 doesn't work on Ubuntu 18.04.1. Only 18.30 and 18.40 are for Ubuntu 18.04.1 and the crash happens with both.

Syd (sydd) updated the task description. (Show Details)Nov 15 2018, 4:54 PM

I tried blender-2.79-968bf0df148 (today's build) and everything works ! The viewport GPU rendering is also at least 10 times faster (I'm not joking). It fixed some other crashs I experienced with the node wrangler, and the final render is finished faster too

Bastien Montagne (mont29) triaged this task as Normal priority.
Brecht Van Lommel (brecht) claimed this task.

Seems this was fixed in the daily builds then.