NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

Unable to enable OpenCL with AMD Radeon VII #128078

Open isti115 opened 3 years ago

isti115 commented 3 years ago

Describe the bug Sorry if this is not a good quality report, this is my first issue here, but I have been struggling with this for several days now and have ran out of ideas that I could try myself. (Previously under Arch I had Blender and DaVinci Resolve running on this card as well, these applications are basically my only remaining problem with my otherwise excellent NixOS experience and I see in another issue that Resolve is currently being worked on.)

I have tried several methods for enabling the OpenCL capabilities of my AMD Radeon VII under NixOS, but Blender does not see the device and clinfo gives an error as well:

HSA Error:  Incompatible kernel and userspace, Device 66af disabled. Upgrade amdgpu.
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP (3241.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [AMD Accelerated Parallel Processing?]
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  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)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.10
  ICD loader Profile                              OpenCL 2.1 

I now refer to the official wiki, since I would consider that to be authoritative: https://nixos.wiki/wiki/AMD_GPU#OpenCL but I have also experimented with this: https://github.com/nixos-rocm/nixos-rocm

To Reproduce Steps to reproduce the behavior:

  1. Have a Radeon VII
  2. Put the following into your /etc/nixos/hardware-configuration.nix:
    hardware.opengl.extraPackages = with pkgs; [
    rocm-opencl-icd
    rocm-opencl-runtime
    ];
  3. Rebuild, switch and reboot 4a. Run blender and see that no OpenCL devices are available 4b. Run clinfo and see the error

Expected behavior The Radeon VII card should show up as an OpenCL compute device in Blender.

Additional context I have already tried running the 5.4 kernel as well, which would be officially supported as far as I can tell, but that didn't improve the situation.

Notify maintainers @siraben @danieldk

Metadata

danieldk commented 3 years ago

The error is mentioned in the release notes:

https://rocmdocs.amd.com/en/latest/Current_Release_Notes/Current-Release-Notes.html#driver-compability-issue-in-rocm-v4-1

Unfortunately, it is not clear what the minimum required driver/kernel version is. I do not have the necessary hardware anymore (and they dropped RX5x0 support), so I can't test this either :(.

pshirshov commented 3 years ago

I'm on 5.10.61 and still experiencing this problem on RVII.

This is definitely something specific to Nix, same card and same kernel works perfectly on gentoo and ubuntu.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info