You are not logged in.

#1 2022-06-30 07:11:32

WonderJ13
Member
Registered: 2022-06-30
Posts: 2

[SOLVED] vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD

EDIT: Original title was too long to add [SOVLED], so I'm posting the original title here.

Original Title:
vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD environment

Original Post:
Hi, this is my first post on these forums, so sorry if this post is a bit all over the place, but I want to provide as much information as possible.

My Setup:
GPU: Gigabyte AMD RX Vega 56
Audio Server: pipewire
Desktop Environment: sway under wayland


I recently moved, and after setting up my computer, I launched steam and tried to play "A Dance of Ice and Fire" (adofai) through proton, only for it to error while booting.
Please note that I was able to play this game perfectly fine before using this exact setup.

Error:

Failed to initialize graphics.
Make sure you have DirectX 11 installed, have up to date
drivers for your graphics card and have not disabled
3D acceleration in display settings.
InitializeEngineGraphics failed

After searching through the archwiki, I was directed towards installing vulkan-tools and check the output of vulkaninfo.
After installing, I ran vulkaninfo only for it to seemingly be stuck in an infinite loop.
I assume it's in an infinite loop as top reported it using 100% of my CPU.

I then check vulkaninfo through gdb and find that it's stuck in vkEnumeratePhysicalDevices. I found posts relating to that function before, but it seemed to be a bug that was already patched (sorry I can't link it, I can't find it!)

I checked more of the utils that came with vulkan-tools and found vkcube. I launched vkcube and it works just fine.

After more messing around, I was directed to install the debug build of vulkan-tools to better debug what was going on.
I found this to not be that helpful at first (no debugging symbols were found? It's been a little bit since I've messed with gdb).

After more testing, I set AMD_VULKAN_ICD=RADV" and tested some more again.
vulkaninfo continued to hang but this time it was using 0% of my CPU.
vkcube ended up crashing due to a SEGFAULT (segmentation fault).
When I tested vkcube on the debug build I found that it failed an assert.

    VkPhysicalDevice *physical_devices = malloc(sizeof(VkPhysicalDevice) * gpu_count);
    err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, physical_devices);
    assert(!err);
    if (demo->gpu_number >= 0 && !((uint32_t)demo->gpu_number < gpu_count)) {
        fprintf(stderr, "GPU %d specified is not present, GPU count = %u\n", demo->gpu_number, gpu_count);
        ERR_EXIT("Specified GPU number is not present", "User Error");
    }

The above code shows where the assert failed. vkEnumeratePhysicalDevices is showing up again!
After checking more of the code, I found I can force an error message by using...

vkcube --gpu_number 0

After more testing, I switch the AMD_VULKAN_ICD env to "AMDVLK", and both vulkaninfo and vkcube revert back to their normal behaviors.

In my research, I found references to /usr/share/vulkan/icd.d/ and I was unsure if it was important in my case. Here's the contents of that folder in case it's relevant.

$ ls
amd_icd32.json  radeon_icd.i686.json
amd_icd64.json  radeon_icd.x86_64.json

I'm currently at a loss as I've been cracking at this problem for the past 3 days. If anyone has any pointers or notes, any help is greatly appreciated!!!

Last edited by WonderJ13 (2022-07-01 07:29:47)

Offline

#2 2022-06-30 07:33:30

mewsen
Member
Registered: 2022-03-08
Posts: 5

Re: [SOLVED] vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD

I'm having the same problem also on sway
CPU: AMD Ryzen 7 5800X (16) @ 3.800GHz
GPU: AMD 6750 XT

i did a full system update and mesa packages were updated and after the reboot games won't run.

vkcube works.

steam console when trying to start a game:
https://pastebin.com/kT2wiWaQ

Offline

#3 2022-06-30 07:50:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,709

Re: [SOLVED] vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD

I'm assuming amdvlk broke their handling of that environment variable. If you opt for the secondary approach mentioned in https://wiki.archlinux.org/title/Vulkan … t_variable via DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 does it work better?

Alternatively just get rid of amdvlk altogether afaik it is still slower than radv in the majority of cases.

Last edited by V1del (2022-06-30 07:51:19)

Online

#4 2022-06-30 08:01:13

mewsen
Member
Registered: 2022-03-08
Posts: 5

Re: [SOLVED] vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD

setting
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
and starting steam like this
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json steam

works !

Offline

#5 2022-07-01 07:27:25

WonderJ13
Member
Registered: 2022-06-30
Posts: 2

Re: [SOLVED] vulkaninfo hangs, vkcube crashes based on AMD_VULKAN_ICD

I just tested the solution on my machine, and I got the game to start running!!!

The only change I made was to add this line to my .bashrc file

export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1

I did not have to launch steam with the VK_ICD_FILENAMES environment var.

Thanks so much!!!

Offline

Board footer

Powered by FluxBB