Everything that goes wrong when I just try to play a game
This is kind of a fever dream of a late evening debugging session fueled by frustration at not being able to play a game. Some parts don’t seem to make sense in hindsight, but I’ll leave this as is for posterity as some steps may prove useful in the future.
Setup
- Framework 16 laptop (AMD Ryzen 7040HS + Radeon RX 7700S)
- Fedora 40 with Linux kernel 6.9.12
- GNOME 46
Problems
Steam crashes on boot
Some kind of SIGSEGV in steamwebhelper. No GUI shows up, just the tray icon. Debugging proves challenging because there’s no symbols available for the crashing place.
Surprisingly, starting steam from the command line works.
Someone on the
internet
suggested setting PrefersNonDefaultGPU=false
in the Steam’s .desktop file.
This allowed Steam to start up.
An alternative was to update the Exec=
entry in `` to:
Exec=env DRI_PRIME=pci-0000_03_00_0! /usr/bin/steam %U
Why?
My hardware has 2 GPUs.
$ sudo lshw -c video
*-display
description: VGA compatible controller
product: Navi 33 [Radeon RX 7700S/7600/7600S/7600M XT/PRO W7600]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:03:00.0
version: c1
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
configuration: driver=amdgpu latency=0
resources: iomemory:840-83f iomemory:860-85f irq:79 memory:8400000000-85ffffffff memory:8600000000-860fffffff ioport:a000(size=256) memory:90c00000-90cfffff memory:90d20000-90d3ffff
*-display
description: VGA compatible controller
product: Phoenix1
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:c4:00.0
version: c2
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi msix vga_controller bus_master cap_list
configuration: driver=amdgpu latency=0
resources: iomemory:860-85f irq:50 memory:8610000000-861fffffff memory:90000000-901fffff ioport:1000(size=256) memory:90500000-9057ffff
It turns out GNOME has a concept of “default GPU”. The idea being, a low-power, integrated GPU is the “default” one, and the power-hungry, dedicated GPU is used only when high performance is needed. The “Run using dedicated/integrated graphics card” option in the context menu controls this selection.
Perhaps surprisingly, the GUI text “integrated” translates to “default GPU”, and “dedicated” to “non-default GPU”. This mechanism sometimes doesn’t work as expected.
The details of how the system determines which GPU is the default one is still a mystery to me.
For one reason or another, on my hardware the dedicated GPU was considered the
“default” one. Because the Steam .desktop shortcut has
PrefersNonDefaultGPU=true
set, it tried to run using the “non-default”,
i.e. integrated GPU, which apparently wasn’t good enough to handle
steamwebhelper
.
Useful tooling
coredumpctl
Systemd tool for managing core dumps.
# show details of a crash
coredumpctl info
# list recent crashes
coredumpctl list
# start gdb session from the last recorded crash
coredumpctl gdb
DRI_PRIME_DEBUG
env var
Setting DRI_PRIME_DEBUG=1
prints extra debug logs, including information on
which GPU was selected to drive GL/Vulkan calls.
Details: https://docs.mesa3d.org/envvars.html#envvar-DRI_PRIME_DEBUG
DRI_PRIME
env var
Allows overriding the GPU selection logic to force using a specific GPU.
Note that applications that use Vulkan can select the GPU on their own.
Appending a !
to the environment variable value forces the GPU to be the
only one exposed to the application, preventing it from using any other GPU.
# select the second (0-indexed) GPU
DRI_PRIME=1 steam
# select the GPU on pci@0000:03:00.0
DRI_PRIME=pci-0000_03_00_0 steam
# select the GPU on pci@0000:03:00.0 and pretend no other GPU exists
DRI_PRIME=pci-0000_03_00_0! steam
Details: https://docs.mesa3d.org/envvars.html#envvar-DRI_PRIME
gdbus
A CLI utility for inspecting DBus objects.
gdbus introspect --system --dest net.hadess.SwitcherooControl --object-path /net/hadess/SwitcherooControl