Fixing electron apps and Steam not working on Wayland (Arch Linux, RDNA3, AMDGPU, broken Vulkan)
I have been bothered with a problem on my laptop, an Framework 13 AMD - Steam and every electron applications (VSCode, Element, electron itself, etc..) won't run on Wayland. They run but hangs without creat. I can run Steam with X11. But it fails to run every game. No matter which version of Proton I use. I gave up and shared this problem with a friend of mine at a hacker meetup, link to his website can be found below. He has experience debugging game related issue on Linux and works closely with game devs to get Linux issue resolbed. He did some magic Googling and eventually we figured out that the problem is with the Vulkan driver.
TL;DR
- Install RADV
sudo pacman -S vulkan-radeon
- Add your user into the
vglusers
groupsudo usermod -aG vglusers $USER
- Relogin
The long story
Initially we only knew that Steam won't run on Wayland and Spelunky 2 would simply show error "Failed to initialize DXGI factory".
![Image: Spelunky 2 with a small error box from WINE showing error Spelunky 2 with a small error box from WINE showing error](/images/gemlog/vulkan-broken-spelinky2.webp)
He speculated that the GPU driver is broken. I rejected as glmark2
ran perfectly. Heck dmesg
is squeaky clean.. We eventually tried to run vulkaninfo
and see maybe something is wrong there. And... yes! Vulkan is indeed broken with error
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/amdvlk64.so. Skipping this driver.
ERROR: [Loader Message] Code 0 : terminator_CreateInstance: Found no drivers!
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /usr/src/debug/vulkan-tools/Vulkan-Tools-1.3.269/vulkaninfo/./vulkaninfo.h:688:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER
From there we tried rolling back the kernel. Didn't work. And noticed I'm using AMDVLK for some reason.. I don't remember installing it. So we tried switching to RADV. Now it errored
RROR: [../mesa-24.1.3/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
Now that's weird. Why in the world would I get permission denied on a DRI device. But progress at least, it is actually doing something. We tried to temporarily work around it by chmod 777 /dev/dri/renderD128
and sudo -E vulkaninfo
. Both resulting in a hang.. And then we tried to GDB and strace
it. Both showing libxcb stuck calling connect()
on an UNIX socket. Why..
A stroke of genius came out of nowhere. He ended up at a forum post with NoMachine causing the same issue. I did tried to install NoMachine a while back. Just never made the connection (like, why would a remote desktop software break Vulkan.. AND how in the bloody world that VirtualGL is related to Vulkan!?). Suggesting to add my user into the vglusers
group.
Anyway, I added my user into the vglusers
group. Logged out and logged back in. vulkaninfo
now works! And so does Steam and the Electron apps!
Yeah this is stupid. But solved and.. yeah.. stupid.
![Author's profile. Photo taken in VRChat by my friend Tast+](/images/profile6.webp)
Martin Chang
Systems software, HPC, GPGPU and AI. I mostly write stupid C++ code. Sometimes does AI research. Chronic VRChat addict
I run TLGS, a major search engine on Gemini. Used by Buran by default.
- marty1885 \at protonmail.com
- Matrix: @clehaxze:matrix.clehaxze.tw
- Jami: a72b62ac04a958ca57739247aa1ed4fe0d11d2df