Page MenuHome

Radeon RX Vega M GL not recognized on Linux
Closed, ResolvedPublic

Description

System Information
Operating system: Mageia 7 x86_64 (Linux)
Graphics card: Intel HD Graphics 630 + discrete AMD Radeon RX Vega M GL

Blender Version
Broken: 2.80 (release) and 2.81-5359b7a03307 (2019-07-30)
Worked: not tested

Short description of error
My HP Spectre x360 laptop has an integrated Intel HD Graphics 630 processor, as well as a discrete AMD Radeon RX Vega M GL.
I use the open source Mesa 19.1.3 driver for both of them, with kernel/amdgpu 5.1.20 for the latter.

To use the discrete GPU, I use the DRI_PRIME=1 environment variable.
Blender then throws this warning in the terminal:

Warning: Could not find a matching GPU name. Things may not behave as expected.
Detected OpenGL configuration:
Vendor: X.Org
Renderer: AMD VEGAM (DRM 3.30.0, 5.1.20-desktop-2.mga7, LLVM 8.0.0)

System info:

While the above file shows that the OpenCL capabilities of the AMD GPU seem fine (confirmed by opencl), it is not listed as recognized in Edit > Settings > System.

Exact steps for others to reproduce the error

  • Start Blender 2.80 with DRI_PRIME=1 ./blender on a system with AMD Radeon RX Vega M GL.

Event Timeline

I found that this might be related to https://developer.blender.org/D2171 since my AMD GPU does use Mesa's Clover OpenCL implementation:

$ ./clinfo --list
Platform #0: Clover
 `-- Device #0: AMD VEGAM (DRM 3.30.0, 5.1.20-desktop-2.mga7, LLVM 8.0.0)
Platform #1: Intel(R) OpenCL HD Graphics
 `-- Device #0: Intel(R) Gen9 HD Graphics NEO

While the above file shows that the OpenCL capabilities of the AMD GPU seem fine (confirmed by opencl), it is not listed as recognized in Edit > Settings > System.

For the reference, D5392 does not fix that.

OpenCL capabilities are checked in https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob/7c5838cfd66a656e3ad422ddbe0f23b31dcff1e3:/intern/cycles/device/opencl/opencl_util.cpp#l731 and currently the only supported devices seem to have to match AMD Accelerated Parallel Processing (I assume it's the platform name on Windows?), which my device doesn't match (AMD VEGAM (DRM 3.30.0, 5.1.20-desktop-2.mga7, LLVM 8.0.0)).

That being said, there might be a good reason for it :)

I brute-forced support for my card with:

diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h
index 82b961b8de7..04f07f30365 100644
--- a/intern/cycles/device/opencl/opencl.h
+++ b/intern/cycles/device/opencl/opencl.h
@@ -90,7 +90,7 @@ class OpenCLInfo {
   static bool device_version_check(cl_device_id device, string *error = NULL);
   static string get_hardware_id(const string &platform_name, cl_device_id device_id);
   static void get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices,
-                                 bool force_all = false);
+                                 bool force_all = true);
 
   /* ** Some handy shortcuts to low level cl*GetInfo() functions. ** */

and it then shows up as a possible OpenCL platform:

I0801 12:04:15.703794 22404 device_opencl.cpp:48] CLEW initialization succeeded.
I0801 12:04:17.453339 22404 opencl_util.cpp:899] Enumerating devices for platform Clover.
I0801 12:04:17.453392 22404 opencl_util.cpp:937] Adding new device AMD VEGAM (DRM 3.30.0, 5.1.20-desktop-2.mga7, LLVM 8.0.0).

But attempting a Cycles render of default cube with this card leads to various errors which point to an OpenCL version mismatch?

OpenCL build failed with error CL_BUILD_PROGRAM_FAILURE, errors in console.
OpenCL program split_bundle build output: source/kernel/kernel_compat_opencl.h:155:9: warning: 'NULL' macro redefined
/usr/include/clc/clcmacros.h:12:9: note: previous definition is here
source/kernel/svm/svm_math_util.h:120:1: error: OpenCL C version 1.1 does not support the 'static' storage class specifier
source/kernel/kernel_compat_opencl.h:39:29: note: expanded from macro 'ccl_static_constant'
source/kernel/svm/svm_math_util.h:129:1: error: OpenCL C version 1.1 does not support the 'static' storage class specifier
source/kernel/kernel_compat_opencl.h:39:29: note: expanded from macro 'ccl_static_constant'
source/kernel/svm/svm_math_util.h:138:1: error: OpenCL C version 1.1 does not support the 'static' storage class specifier
source/kernel/kernel_compat_opencl.h:39:29: note: expanded from macro 'ccl_static_constant'
source/kernel/svm/svm_wavelength.h:43:1: error: OpenCL C version 1.1 does not support the 'static' storage class specifier
source/kernel/kernel_compat_opencl.h:39:29: note: expanded from macro 'ccl_static_constant'

I0801 11:56:51.540627 12555 opencl_util.cpp:297] OpenCL program split_bundle not found in cache.
I0801 11:56:51.592937 12555 opencl_util.cpp:297] OpenCL program split_bundle not found on disk.
Split kernel error: failed to load kernel_path_init
I0801 11:56:51.593288 12519 blender_session.cpp:585] Total render time: 3.27015
I0801 11:56:51.593300 12519 blender_session.cpp:586] Render time (without synchronization): -2.28938
I0801 11:56:51.593897 12519 util_task.cpp:347] De-initializing thread pool of task scheduler.
Error: Split kernel error: failed to load kernel_path_init
Sebastian Parborg (zeddb) triaged this task as Normal priority.

@Clément Foucault (fclem) I guess we just add Vega M to the GPU string list?

@Rémi Verschelde (akien) You will not be able to use Clover with blender. It can not handel Cycles and there for we have disabled it.
The warning message is harmless.