Steam crashes when launched from wofi but not from terminal

Hello,
I recently upgraded my computer and installed the new Garuda Hyprland release. I have encountered a strange issue… I’ve installed Steam (runtime) and whenever I launch it from Wofi its UI components crash, while if I launch it from the terminal it works fine. What could be making the difference between these two launch methods?

INXI:

System:
  Kernel: 6.9.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.1.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=a611be7b-91f5-4264-9001-bd468b5a27b3 rw rootflags=subvol=@
    quiet loglevel=3 ibt=off
  Desktop: Hyprland v: 0.40.0 with: waybar tools: avail: swayidle,swaylock
    vt: 1 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
  Type: Desktop Mobo: Gigabyte model: B650 GAMING X AX V2 v: x.x
    serial: <superuser required> uuid: <superuser required> UEFI: American
    Megatrends LLC. v: F3 date: 01/10/2024
CPU:
  Info: model: AMD Ryzen 7 7800X3D bits: 64 type: MT MCP arch: Zen 4 gen: 5
    level: v4 note: check built: 2022+ process: TSMC n5 (5nm) family: 0x19 (25)
    model-id: 0x61 (97) stepping: 2 microcode: 0xA601206
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 8 MiB desc: 8x1024 KiB
    L3: 96 MiB desc: 1x96 MiB
  Speed (MHz): avg: 1455 high: 4440 min/max: 400/5050 scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 400 2: 3847 3: 3335
    4: 400 5: 400 6: 400 7: 4440 8: 3192 9: 400 10: 400 11: 4074 12: 400
    13: 400 14: 400 15: 400 16: 400 bogomips: 134144
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: AMD Navi 32 [Radeon RX 7700 XT / 7800 XT] vendor: ASRock
    driver: amdgpu v: kernel arch: RDNA-3 code: Navi-3x process: TSMC n5 (5nm)
    built: 2022+ pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
    active: DP-1,DP-2 empty: DP-3,HDMI-A-1,Writeback-1 bus-ID: 03:00.0
    chip-ID: 1002:747e class-ID: 0300
  Device-2: AMD Raphael vendor: Gigabyte driver: amdgpu v: kernel
    arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22 pcie:
    gen: 4 speed: 16 GT/s lanes: 16 ports: active: none empty: DP-4, DP-5,
    DP-6, HDMI-A-2, Writeback-2 bus-ID: 12:00.0 chip-ID: 1002:164e
    class-ID: 0300 temp: 36.0 C
  Device-3: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3:3 chip-ID: 046d:0825
    class-ID: 0102 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0
    compositor: Hyprland v: 0.40.0 driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu d-rect: 5120x1440 display-ID: 1
  Monitor-1: DP-1 pos: primary,left model: VG27AQL1A serial: <filter>
    built: 2023 res: 2560x1440 hz: 144 dpi: 109 gamma: 1.2 scale: 1
    size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:
    max: 2560x1440 min: 720x400
  Monitor-2: DP-2 pos: right model: Acer XF270HU serial: <filter>
    built: 2019 res: 2560x1440 hz: 144 dpi: 109 gamma: 1.2 scale: 1
    size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:
    max: 2560x1440 min: 720x400
  API: Vulkan v: 1.3.279 layers: 10 device: 0 type: discrete-gpu name: AMD
    Radeon RX 7800 XT (RADV NAVI32) driver: mesa radv v: 24.1.0-arch1.1
    device-ID: 1002:747e surfaces: xcb,xlib,wayland device: 1
    type: integrated-gpu name: AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)
    driver: mesa radv v: 24.1.0-arch1.1 device-ID: 1002:164e
    surfaces: xcb,xlib,wayland device: 2 type: cpu name: llvmpipe (LLVM
    17.0.6 256 bits) driver: mesa llvmpipe v: 24.1.0-arch1.1 (LLVM 17.0.6)
    device-ID: 10005:0000 surfaces: xcb,xlib,wayland
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: AMD Navi 31 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 03:00.1 chip-ID: 1002:ab30
    class-ID: 0403
  Device-2: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 12:00.1
    chip-ID: 1002:1640 class-ID: 0403
  Device-3: AMD Family 17h/19h HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 12:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Device-4: PreSonus Audio AudioBox USB 96 driver: snd-usb-audio type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-2:2 chip-ID: 194f:0303
    class-ID: fe01 serial: <filter>
  Device-5: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3:3 chip-ID: 046d:0825
    class-ID: 0102 serial: <filter>
  Device-6: Logitech G535 Wireless Gaming Headset
    driver: cdc_acm,hid-generic,snd-usb-audio,usbhid type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 7-1.2:4 chip-ID: 046d:0ac4
    class-ID: 0a00
  API: ALSA v: k6.9.3-zen1-1-zen status: kernel-api tools: N/A
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1
    bus-ID: 09:00.0 chip-ID: 14c3:0616 class-ID: 0280
  IF: wlp9s0 state: down mac: <filter>
  Device-2: Realtek RTL8125 2.5GbE vendor: Gigabyte driver: r8169 v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 1 port: e000 bus-ID: 0a:00.0
    chip-ID: 10ec:8125 class-ID: 0200
  IF: enp10s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Info: services: NetworkManager, smbd, systemd-timesyncd, wpa_supplicant
Bluetooth:
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-9:6 chip-ID: 0e8d:0616
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c0104
Drives:
  Local Storage: total: 4.29 TiB used: 751.12 GiB (17.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 990 PRO 2TB
    size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 4B2QJXD7 temp: 43.9 C
  ID-2: /dev/sda maj-min: 8:0 vendor: PNY model: SSD2SC480G1CS1754D117-514
    size: 447.13 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 1101 scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 3B6Q scheme: GPT
  ID-4: /dev/sdc maj-min: 8:32 vendor: PNY model: SSD2SC240G1CS1754D117-820
    size: 223.57 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 1101 scheme: GPT
  ID-5: /dev/sdd maj-min: 8:48 vendor: Samsung model: HD103SJ
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: 0001 scheme: MBR
Partition:
  ID-1: / raw-size: 269.65 GiB size: 269.65 GiB (100.00%)
    used: 14.63 GiB (5.4%) fs: btrfs dev: /dev/sdb5 maj-min: 8:21
  ID-2: /boot/efi raw-size: 600 MiB size: 598.8 MiB (99.80%)
    used: 12.1 MiB (2.0%) fs: vfat dev: /dev/sdb1 maj-min: 8:17
  ID-3: /home raw-size: 269.65 GiB size: 269.65 GiB (100.00%)
    used: 14.63 GiB (5.4%) fs: btrfs dev: /dev/sdb5 maj-min: 8:21
  ID-4: /var/log raw-size: 269.65 GiB size: 269.65 GiB (100.00%)
    used: 14.63 GiB (5.4%) fs: btrfs dev: /dev/sdb5 maj-min: 8:21
  ID-5: /var/tmp raw-size: 269.65 GiB size: 269.65 GiB (100.00%)
    used: 14.63 GiB (5.4%) fs: btrfs dev: /dev/sdb5 maj-min: 8:21
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 30.5 GiB used: 47 MiB (0.2%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 51.1 C mobo: 40.0 C
  Fan Speeds (rpm): N/A
  GPU: device: amdgpu temp: 57.0 C mem: 66.0 C fan: 0 watts: 16.00
    device: amdgpu temp: 36.0 C
Info:
  Memory: total: 32 GiB note: est. available: 30.5 GiB used: 4.87 GiB (16.0%)
  Processes: 385 Power: uptime: 1h 36m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 12.19 GiB services: upowerd Init: systemd
    v: 255 default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 1453 libs: 405 tools: pacseek,paru Compilers:
    gcc: 14.1.1 Shell: garuda-inxi default: fish v: 3.7.1 running-in: foot
    inxi: 3.3.34
Garuda (2.6.26-1):
  System install date:     2024-05-29
  Last full system update: 2024-06-01 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            

Here is the journal leading up to the crash:

Jun 01 13:12:59 pelotron-garuda rtkit-daemon[2273]: Supervising 1 threads of 1 processes of 1 users.
Jun 01 13:13:03 pelotron-garuda sudo[3488]:     zach : a password is required ; TTY=pts/0 ; PWD=/home/zach ; USER=root ; COMM
AND=/usr/bin/true
Jun 01 13:13:25 pelotron-garuda systemd[1]: systemd-timedated.service: Deactivated successfully.
Jun 01 13:13:48 pelotron-garuda sudo[3690]:     zach : a password is required ; TTY=pts/0 ; PWD=/home/zach ; USER=root ; COMM
AND=/usr/bin/true
Jun 01 13:14:04 pelotron-garuda rtkit-daemon[2273]: Supervising 1 threads of 1 processes of 1 users.
Jun 01 13:14:04 pelotron-garuda rtkit-daemon[2273]: Supervising 1 threads of 1 processes of 1 users.
Jun 01 13:14:17 pelotron-garuda rtkit-daemon[2273]: Supervising 1 threads of 1 processes of 1 users.
Jun 01 13:14:17 pelotron-garuda rtkit-daemon[2273]: Supervising 1 threads of 1 processes of 1 users.
Jun 01 13:15:05 pelotron-garuda sudo[4040]:     zach : a password is required ; TTY=pts/0 ; PWD=/home/zach ; USER=root ; COMM
AND=/usr/bin/true
Jun 01 13:15:29 pelotron-garuda sudo[4127]:     zach : a password is required ; TTY=pts/0 ; PWD=/home/zach ; USER=root ; COMM
AND=/usr/bin/true
Jun 01 13:16:00 pelotron-garuda systemd[1]: Starting Daemon for power management...
Jun 01 13:16:00 pelotron-garuda systemd[1]: Started Daemon for power management.
Jun 01 13:16:00 pelotron-garuda kernel: gldriverquery[4559]: segfault at 7415c8cbfb64 ip 000073cdc938ba76 sp 00007ffc94767460
 error 4 in libEGL_mesa.so.0.0.0[73cdc9370000+2b000] likely on CPU 12 (core 4, socket 0)
Jun 01 13:16:00 pelotron-garuda kernel: Code: 16 87 70 01 00 00 0f 11 46 18 c3 66 0f 1f 84 00 00 00 00 00 55 48 89 e5 53 89 f
b 48 83 ec 08 67 e8 8f 9f 00 00 48 85 c0 74 2a <83> 78 44 01 75 24 8d 83 69 ff ff ff 3d 13 01 00 00 77 17 48 8d 15
Jun 01 13:16:00 pelotron-garuda systemd[1]: Created slice Slice /system/systemd-coredump.
Jun 01 13:16:00 pelotron-garuda systemd[1]: Started Process Core Dump (PID 4577/UID 0).
Jun 01 13:16:00 pelotron-garuda systemd[1]: Starting Disk Manager...
Jun 01 13:16:00 pelotron-garuda udisksd[4580]: udisks daemon version 2.10.1 starting
Jun 01 13:16:00 pelotron-garuda systemd[1]: Started Disk Manager.
Jun 01 13:16:00 pelotron-garuda udisksd[4580]: Acquired the name org.freedesktop.UDisks2 on the system message bus
Jun 01 13:16:00 pelotron-garuda systemd-coredump[4578]: [🡕] Process 4559 (gldriverquery) of user 1000 dumped core.
                                                        
                                                        Stack trace of thread 4559:
                                                        #0  0x000073cdc938ba76 n/a (libEGL_mesa.so.0 + 0x21a76)
                                                        #1  0x000073cdc938cc5c n/a (libEGL_mesa.so.0 + 0x22c5c)
                                                        #2  0x000073cdc939000a n/a (libEGL_mesa.so.0 + 0x2600a)
                                                        #3  0x000073cdc9385359 n/a (libEGL_mesa.so.0 + 0x1b359)
                                                        #4  0x000073cdc937383c n/a (libEGL_mesa.so.0 + 0x983c)
                                                        #5  0x000073cdc9ee0c34 n/a (libSDL2-2.0.so.0 + 0xbcc34)
                                                        #6  0x000073cdc9f2e965 n/a (libSDL2-2.0.so.0 + 0x10a965)
                                                        #7  0x000073cdc9eee913 n/a (libSDL2-2.0.so.0 + 0xca913)
                                                        #8  0x00005cef9660f9bc n/a (/home/zach/.local/share/Steam/ubuntu12_64
/gldriverquery + 0xf9bc)
                                                        #9  0x00005cef9660fb20 n/a (/home/zach/.local/share/Steam/ubuntu12_64
/gldriverquery + 0xfb20)
                                                        #10 0x000073cdc9c5dc88 n/a (libc.so.6 + 0x25c88)
                                                        #11 0x000073cdc9c5dd4c __libc_start_main (libc.so.6 + 0x25d4c)
                                                        #12 0x00005cef9660b5ba n/a (/home/zach/.local/share/Steam/ubuntu12_64
/gldriverquery + 0xb5ba)
                                                        ELF object binary architecture: AMD x86-64
Jun 01 13:16:00 pelotron-garuda systemd[1]: [email protected]: Deactivated successfully.
Jun 01 13:16:03 pelotron-garuda systemd[1]: proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_
misc, triggered by 4694 (steamwebhelper)
Jun 01 13:16:03 pelotron-garuda systemd[1]: Mounting Arbitrary Executable File Formats File System...
Jun 01 13:16:03 pelotron-garuda systemd[1]: Mounted Arbitrary Executable File Formats File System.
Jun 01 13:16:04 pelotron-garuda systemd[1]: Started Process Core Dump (PID 4906/UID 0).
Jun 01 13:16:04 pelotron-garuda systemd-coredump[4908]: [🡕] Process 4694 (steamwebhelper) of user 1000 dumped core.
                                                        
                                                        Stack trace of thread 4877:
                                                        #0  0x0000000000000000 n/a (n/a + 0x0)
                                                        ELF object binary architecture: AMD x86-64
Jun 01 13:16:04 pelotron-garuda systemd[1]: [email protected]: Deactivated successfully.

And here is the backtrace of the crashed process:

Core was generated by `/home/zach/.local/share/Steam/ubuntu12_32/../ubuntu12_64/gldriverquery'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  dri2_wl_visual_idx_from_pipe_format () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:173
173   if (util_format_is_srgb(pipe_format))                                                                             
[Current thread is 1 (Thread 0x73cdc9b4c300 (LWP 4559))]
(gdb) bt
#0  dri2_wl_visual_idx_from_pipe_format () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:173
#1  0x000073cdc938cc5c in server_supports_pipe_format () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:260
#2  dri2_wl_add_configs_for_visuals () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:1992
#3  0x000073cdc939000a in dri2_initialize_wayland_drm () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:2178
#4  dri2_initialize_wayland () at ../mesa-24.1.0/src/egl/drivers/dri2/platform_wayland.c:2869
#5  0x000073cdc9385359 in dri2_initialize () at ../mesa-24.1.0/src/egl/drivers/dri2/egl_dri2.c:1080
#6  0x000073cdc937383c in eglInitialize () at ../mesa-24.1.0/src/egl/main/eglapi.c:698
#7  0x000073cdc9ee0c34 in SDL_EGL_LoadLibrary (_this=0x5cefca127da0, native_display=0x5cefca1238c0, 
    platform=<optimized out>, egl_path=<optimized out>) at /usr/src/debug/sdl2/SDL2-2.30.3/src/video/SDL_egl.c:547
#8  0x000073cdc9f2e965 in SDL_EGL_LoadLibrary (platform=0, native_display=0x5cefca1238c0, egl_path=<optimized out>, 
    _this=0x5cefca127da0) at /usr/src/debug/sdl2/SDL2-2.30.3/src/video/SDL_egl.c:504
#9  Wayland_GLES_LoadLibrary (_this=0x5cefca127da0, path=<optimized out>)
    at /usr/src/debug/sdl2/SDL2-2.30.3/src/video/wayland/SDL_waylandopengles.c:43
#10 0x000073cdc9eee913 in SDL_GL_LoadLibrary_REAL (path=<optimized out>)
    at /usr/src/debug/sdl2/SDL2-2.30.3/src/video/SDL_video.c:3445
#11 0x00005cef9660f9bc in init_screen(char const*) ()
#12 0x00005cef9660fb20 in main ()

After the crash there is still a Steam background process running and an icon in the systray, but it requires SIGKILL to end it.

Thanks for any ideas you have!

Wofi will launch the application with the Exec= line in the .desktop file. Look for the .desktop file in /usr/share/applications/ and check what the Exec= line says.

1 Like

Thanks, that’s good to know. The Exec line was running “/usr/bin/steam-runtime %U”. I don’t know what the %U parameter is supposed to be but I tried deleting it, changing the Exec to just “steam”, and changing it to “nohup steam &” (which is what I’m doing to get success in a terminal now) and still have the same failure.

The Exec= line in a .desktop file doesn’t take raw shell syntax like that, you would have to launch a shell and then have the shell interpret the command.

Try adding it like this:

Exec=bash -c 'nohup steam &'

Unfortunately that crashes as well. I did look in nohup.out and expected to see the normal steam process logging but instead just saw a few messages printed from .local/share/Steam/steam.sh. I thought that was unusual so I tried launching it from the terminal with “bash .local/share/Steam/steam.sh” and it worked, while using that in the .desktop file failed again.

Hunch, based on nothing in particular, other than similar issues myself in the distant past.
Lots of time it has to do with the environment in your shell session that may not be present in umm your target.

Check to see if you have a desktop file in ~/.local/share/applications/. If you do, it will override the one in /usr/share/applications (which would explain why changing it is having no effect).

1 Like

No file in .local/share/applications. Though I did already try setting the one in /usr/share/applications to launch an entirely different app, which did work.

Try adding debugging by redirecting standard output and standard error to a file.

Exec=bash -c 'nohup steam > /path/to/debug.log 2>&1 &'

Then launch the application, and after it crashes we can take a look at the debug log to see if there are any clues about what is happening.

1 Like

Hmm, this doesn’t seem to be logging anything useful:

File: debug.log
steam.sh[44431]: Running Steam on garuda Soaring 64-bit
steam.sh[44431]: STEAM_RUNTIME is enabled automatically
setup.sh[44511]: Steam runtime environment up-to-date!

Hmm, I agree that output is distinctly not useful.

I think @dbarron may be on to something with their hunch regarding a difference in the environment variables or configurations between the two launch methods. Try comparing the environment variables set when launching from Wofi and from the terminal by running env in both environments and compare the outputs.

From the terminal you can output to a log like this:

env > terminal_env.txt

For Wofi, temporarily change the Exec= line in the Steam .desktop file to do something similar:

Exec=bash -c 'env > wofi_env.txt'

Then launch Steam from Wofi to grab that log file.

Compare the terminal_env.txt and wofi_env.txt files. Look for differences that might affect the graphics or input settings, such as DISPLAY, WAYLAND_DISPLAY, XDG_SESSION_TYPE, etc.

diff terminal_env.txt wofi_env.txt

You can test adding an environment variable which is missing from the Wofi environment into the .desktop file by adding env FOO=bar to the Exec= line, as described here: https://wiki.archlinux.org/title/Desktop_entries#Modify_environment_variables

For example, to add the DISPLAY environment variable to the Steam command you had might look like this:

Exec=env DISPLAY=:0 bash -c 'nohup steam &'