Vulkan cannot initialize with AMD GPU

I have an AMD Vega 56 GPU in my system, and vulkan does not seem to work with amdgpu mesa drivers. I have run sudo pacman -Syu, yay -Syu and eos-update --yay, so everything should be up-to-date. What could be the problem here?

I get these errors:

$ vulkaninfo
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR at /usr/src/debug/vulkan-tools/Vulkan-Tools-1.3.269/vulkaninfo/./vulkaninfo.h:237:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED
$ vkcube
vkEnumeratePhysicalDevices reported zero accessible devices.

Do you have a compatible Vulkan installable client driver (ICD) installed?
Please look at the Getting Started guide for additional information.

More info:

$ pacman -Qs vulkan                                                                                                                                                                                                        
local/dxvk-bin 2.3.1-1
    A Vulkan-based compatibility layer for Direct3D 9/10/11 which allows running 3D applications on Linux using Wine (Windows DLL binary files)
local/goverlay 1.1.1-2
    A GUI to help manage Vulkan/OpenGL overlays
local/lib32-vulkan-icd-loader 1.3.279-1
    Vulkan Installable Client Driver (ICD) Loader (32-bit)
local/lib32-vulkan-mesa-layers 1:24.1.2-1
    Mesa's Vulkan layers - 32-bit
local/lib32-vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs - 32-bit
local/mangohud 0.7.2-1
    A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more.
local/qt6-shadertools 6.7.2-1 (qt6)
    Provides functionality for the shader pipeline that allows Qt Quick to operate on Vulkan, Metal, and Direct3D, in addition to OpenGL
local/spirv-tools 2024.2-1 (vulkan-devel)
    API and commands for processing SPIR-V modules
local/vkd3d 1.11-1
    Direct3D 12 to Vulkan translation library By WineHQ
local/vulkan-headers 1:1.3.285-1 (vulkan-devel)
    Vulkan header files
local/vulkan-icd-loader 1.3.285-1
    Vulkan Installable Client Driver (ICD) Loader
local/vulkan-mesa-layers 1:24.1.2-1
    Mesa's Vulkan layers
local/vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs
local/vulkan-tools 1.3.269-1 (vulkan-devel)
    Vulkan Utilities and Tools
$ pacman -Qs linux-firmware
local/linux-firmware 20240610.9c10a208-1
    Firmware files for Linux
local/linux-firmware-whence 20240610.9c10a208-1
    Firmware files for Linux - contains the WHENCE license file which documents the vendor license details
$ lspci -k | grep -A3 VGA
0c:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c3)
        Subsystem: Sapphire Technology Limited Radeon RX VEGA 56 Pulse 8GB OC HBM2
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu
$ sudo dmesg | grep amdgpu
[    0.000000] Command line: initrd=\*random id*\6.9.7-arch1-1\initrd nvme_load=YES nowatchdog rw root=UUID=*random id* amdgpu.ppfeaturemask=0xffffffff systemd.machine_id=*random id*
[    0.036657] Kernel command line: initrd=\*random id*\6.9.7-arch1-1\initrd nvme_load=YES nowatchdog rw root=UUID=*random id* amdgpu.ppfeaturemask=0xffffffff systemd.machine_id=*random id*
[    2.964588] [drm] amdgpu kernel modesetting enabled.
[    2.974083] amdgpu: Virtual CRAT table created for CPU
[    2.974094] amdgpu: Topology: Add CPU node
[    2.974333] amdgpu 0000:0c:00.0: No more image in the PCI ROM
[    2.974347] amdgpu 0000:0c:00.0: amdgpu: Fetched VBIOS from ROM BAR
[    2.974349] amdgpu: ATOM BIOS: 113-376XL-U44
[    3.043915] amdgpu 0000:0c:00.0: vgaarb: deactivate vga console
[    3.043919] amdgpu 0000:0c:00.0: amdgpu: Trusted Memory Zone (TMZ) feature not supported
[    3.043945] amdgpu 0000:0c:00.0: amdgpu: MEM ECC is not presented.
[    3.043946] amdgpu 0000:0c:00.0: amdgpu: SRAM ECC is not presented.
[    3.043969] amdgpu 0000:0c:00.0: amdgpu: VRAM: 8176M 0x000000F400000000 - 0x000000F5FEFFFFFF (8176M used)
[    3.043972] amdgpu 0000:0c:00.0: amdgpu: GART: 512M 0x0000000000000000 - 0x000000001FFFFFFF
[    3.044055] [drm] amdgpu: 8176M of VRAM memory ready
[    3.044058] [drm] amdgpu: 15999M of GTT memory ready.
[    3.044672] amdgpu: hwmgr_sw_init smu backed is vega10_smu
[    3.235770] amdgpu 0000:0c:00.0: amdgpu: reserve 0x400000 from 0xf5fec00000 for PSP TMR
[    3.747832] amdgpu: HMM registered 8176MB device memory
[    3.749143] kfd kfd: amdgpu: Allocated 3969056 bytes on gart
[    3.749153] kfd kfd: amdgpu: Total number of KFD nodes to be created: 1
[    3.749251] amdgpu: Virtual CRAT table created for GPU
[    3.749401] amdgpu: Topology: Add dGPU node [0x687f:0x1002]
[    3.749403] kfd kfd: amdgpu: added device 1002:687f
[    3.749417] amdgpu 0000:0c:00.0: amdgpu: SE 4, SH per SE 1, CU per SH 16, active_cu_number 56
[    3.749421] amdgpu 0000:0c:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
[    3.749423] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[    3.749425] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[    3.749426] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[    3.749427] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[    3.749428] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[    3.749430] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[    3.749431] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[    3.749432] amdgpu 0000:0c:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[    3.749433] amdgpu 0000:0c:00.0: amdgpu: ring kiq_0.2.1.0 uses VM inv eng 11 on hub 0
[    3.749434] amdgpu 0000:0c:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 8
[    3.749436] amdgpu 0000:0c:00.0: amdgpu: ring page0 uses VM inv eng 1 on hub 8
[    3.749437] amdgpu 0000:0c:00.0: amdgpu: ring sdma1 uses VM inv eng 4 on hub 8
[    3.749438] amdgpu 0000:0c:00.0: amdgpu: ring page1 uses VM inv eng 5 on hub 8
[    3.749440] amdgpu 0000:0c:00.0: amdgpu: ring uvd_0 uses VM inv eng 6 on hub 8
[    3.749441] amdgpu 0000:0c:00.0: amdgpu: ring uvd_enc_0.0 uses VM inv eng 7 on hub 8
[    3.749442] amdgpu 0000:0c:00.0: amdgpu: ring uvd_enc_0.1 uses VM inv eng 8 on hub 8
[    3.749443] amdgpu 0000:0c:00.0: amdgpu: ring vce0 uses VM inv eng 9 on hub 8
[    3.749445] amdgpu 0000:0c:00.0: amdgpu: ring vce1 uses VM inv eng 10 on hub 8
[    3.749446] amdgpu 0000:0c:00.0: amdgpu: ring vce2 uses VM inv eng 11 on hub 8
[    3.750990] [drm] Initialized amdgpu 3.57.0 20150101 for 0000:0c:00.0 on minor 1
[    3.779258] fbcon: amdgpudrmfb (fb0) is primary device
[    3.910409] amdgpu 0000:0c:00.0: [drm] fb0: amdgpudrmfb frame buffer device
[    5.552925] snd_hda_intel 0000:0c:00.1: bound 0000:0c:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
$ ls -l /usr/share/vulkan/icd.d/
total 8
-rw-r--r-- 1 root root 149 Jun 20 05:42 radeon_icd.i686.json
-rw-r--r-- 1 root root 147 Jun 20 05:32 radeon_icd.x86_64.json

It works fine on my system. Do you have it set up properly?

Edit:

https://wiki.archlinux.org/title/AMDGPU

https://wiki.archlinux.org/title/Vulkan

Edit: Not sure if your gpu falls under this?

Edit: I have an RX 590 which is supported.

Okay i read further and this relates only to amdvlk i think. I use vulkan-radeon.

Edit: As per the wiki

For Vulkan support:

I have set up everything for AMDGPU and it seems to be loaded properly based on the logs above. I have installed the RADV implementation, (lib32-)vulkan-radeon packages are installed, but the guide says verificaiton with vulkaninfo and there I have the errors above.

Not sure if your gpu falls under this?

It falls under that, so I do not use the official AMD implementation, (lib32-)amdvlk are not installed on my system.

I’m not familiar with this.

Okay. Not sure why you are getting the error. Mine works properly. I have it all set as per the wiki including hardware acceleration.

https://0x0.st/XaLA.txt

$ pacman -Qs amd
local/amd-ucode 20240610.9c10a208-1
    Microcode update image for AMD CPUs
local/lib32-vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs - 32-bit
local/libteam 1.32-1
    Library for controlling team network device
local/vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs
local/xf86-video-amdgpu 23.0.0-2 (xorg-drivers)
    X.org amdgpu video driver

From the vulkan wiki page:
vulkan-radeon (or lib32-vulkan-radeon) - RADV (part of Mesa project)

I am also on Kde Wayland btw.

Yes RADV = radeon-vulkan. :person_facepalming:

I am using KDE, and tested both wayland and x11. Wayland started to act since an eos-update --yay upgrade 2 day ago, so I am currently using x11.

Not sure where to look based on this error? You have other software installed than i do such as steam etc.

I have steam and probably several other software installed. This is my daily OS and is not a fresh clean install.

[ricklinux@rick-ms7c37 ~]$ pacman -Qs vulkan 
local/lib32-vulkan-icd-loader 1.3.279-1
    Vulkan Installable Client Driver (ICD) Loader (32-bit)
local/lib32-vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs - 32-bit
local/qt6-shadertools 6.7.2-1 (qt6)
    Provides functionality for the shader pipeline that allows Qt Quick to operate on Vulkan, Metal, and
    Direct3D, in addition to OpenGL
local/spirv-tools 2024.2-1 (vulkan-devel)
    API and commands for processing SPIR-V modules
local/vulkan-headers 1:1.3.285-1 (vulkan-devel)
    Vulkan header files
local/vulkan-icd-loader 1.3.285-1
    Vulkan Installable Client Driver (ICD) Loader
local/vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs
local/vulkan-tools 1.3.269-1 (vulkan-devel)
    Vulkan Utilities and Tools
[ricklinux@rick-ms7c37 ~]$ 

Edit: Maybe someone else can point you in the right direction. :man_shrugging:

I will delete mangohud and (lib32-)vulkan-mesa-layers and retest.

1 Like
$ pacman -Qs vulkan
local/dxvk-bin 2.3.1-1
    A Vulkan-based compatibility layer for Direct3D 9/10/11 which allows running 3D applications on Linux using Wine (Windows DLL binary files)
local/lib32-vulkan-icd-loader 1.3.279-1
    Vulkan Installable Client Driver (ICD) Loader (32-bit)
local/lib32-vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs - 32-bit
local/qt6-shadertools 6.7.2-1 (qt6)
    Provides functionality for the shader pipeline that allows Qt Quick to operate on Vulkan, Metal, and Direct3D, in addition to OpenGL
local/spirv-tools 2024.2-1 (vulkan-devel)
    API and commands for processing SPIR-V modules
local/vkd3d 1.11-1
    Direct3D 12 to Vulkan translation library By WineHQ
local/vulkan-headers 1:1.3.285-1 (vulkan-devel)
    Vulkan header files
local/vulkan-icd-loader 1.3.285-1
    Vulkan Installable Client Driver (ICD) Loader
local/vulkan-radeon 1:24.1.2-1
    Open-source Vulkan driver for AMD GPUs
local/vulkan-tools 1.3.269-1 (vulkan-devel)
    Vulkan Utilities and Tools

Resulted in:

$ vulkaninfo
ERROR: [../mesa-24.1.2/src/amd/vulkan/radv_physical_device.c:1929] Code 0 : Could not open device /dev/dri/renderD128: Permission denied (VK_ERROR_INCOMPATIBLE_DRIVER)
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR at /usr/src/debug/vulkan-tools/Vulkan-Tools-1.3.269/vulkaninfo/./vulkaninfo.h:237:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED

For some reason now sudo vulkaninfo already gives proper output.

I do not believe this is a good solution but after uninstalling all the software that might cause issues, I just did:

$ sudo chmod 666 /dev/dri/renderD128
$ sudo chmod 666 /dev/dri/card*

And it works now.

I’m not one to change permissions typically on linux so i don’t know. Normally wouldn’t it be 777?

Edit: Glad it’s working for you.
Edit: I’m not sure if this is how to check this?

[ricklinux@rick-ms7c37 ~]$ ls -l /dev/dri/renderD128
crw-rw-rw- 1 root render 226, 128 Jul  2 09:48 /dev/dri/renderD128

[ricklinux@rick-ms7c37 ~]$ ls -l /dev/dri/card*
crw-rw----+ 1 root video 226, 1 Jul  2 11:23 /dev/dri/card1

Your /dev/dri/renderD128 is already 666, and the /dev/dri/card1 is 660. I might give it a try, but (lib32-)vulkan-mesa-layers was necessary before this.

It seems the card access is not necessary. The final solution was:

$ sudo pacman -Rs vulkan-mesa-layers lib32-vulkan-mesa-layers
$ sudo chmod 666 /dev/dri/renderD128
1 Like