Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New steam UI does not open if run with DRI_PRIME=1 #9383

Open
koresh-krasa opened this issue Apr 28, 2023 · 134 comments
Open

New steam UI does not open if run with DRI_PRIME=1 #9383

koresh-krasa opened this issue Apr 28, 2023 · 134 comments

Comments

@koresh-krasa
Copy link

koresh-krasa commented Apr 28, 2023

Your system information

  • Steam client version (build number or date): 1682634349
  • Distribution (e.g. Ubuntu): Fedora Silverblue 38
  • Opted into Steam client beta?: [Yes/No] Yes
  • Have you checked for system updates?: [Yes/No] Yes

Please describe your issue in as much detail as possible:

Similar symptoms as #9381
Login prompt displayed correctly but than main window tries to appear but crashes and goes into loop.
This issue is happening if DRI_PRIME is set to non 0 (e.g. DRI_PRIME=1, DRI_PRIME=pci-0000_03_00_0) DRI_PRIME=0 works fine.

In journalctl I was able to find some error logs related to steamwebhelper crash.
steam_journalctl.txt

Optput from DRI_PRIME=1 com.valvesoftware.Steam
steam_output.txt

Steam client is flatpak

System information:
https://gist.github.com/koresh-krasa/b9a7a4c486ff061b9823aea6ce44f65b

DRI_PRIME=1 was working before this update

Steps for reproducing this issue:

  1. Open steam with DRI_PRIME set as non 0 / from Gnome application menu
  2. Login splash window works as expected
  3. Main window is not appearing
    Screencast from 2023-04-28 11-23-06.webm
@arrowgent
Copy link

can you test

DRI_PRIME=1 glxgears

@koresh-krasa
Copy link
Author

koresh-krasa commented Apr 28, 2023

#9383 (comment)

This works fine from flatpak sandbox with same runtime as Steam

@kisak-valve
Copy link
Member

Hello @koresh-krasa, please copy your system information from Steam (Steam -> Help -> System Information) and put it in a gist, then include a link to the gist in this issue report.

Blind guess that this is related to https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101.

@bessman
Copy link

bessman commented Apr 28, 2023

please copy your system information from Steam (Steam -> Help -> System Information)

Since I'm also seeing the same behavior, I figured I'd provide my own system information. But due to #9398, I cannot 😞

@koresh-krasa
Copy link
Author

koresh-krasa commented Apr 28, 2023

@kisak-valve System information from stable client
https://gist.github.com/koresh-krasa/b9a7a4c486ff061b9823aea6ce44f65b

DRI_PRIME=1 was working before this update. Also similar behavior was present with new gamepadui before (similar to #9190)

@jntesteves
Copy link

@kisak-valve I see 2 issues here:

  1. In the new UI framework, Steam can't create a window using a dGPU. That's the most obvious problem, Steam should be able to use any GPU. I'm sure Valve's developers are already looking for a solution to this.
  2. That Steam is requesting a non-default GPU in the first place is an issue in itself. There's no reason for Steam to wake-up a dGPU in a laptop, that's wasteful. Only games should require using a dGPU, and even then, not all games require that.

Solving issue 2 is pretty easy, just remove the options from the desktop file. I've sent a PR to fix that in the Flatpak package for now, until it's removed upstream: flathub/com.valvesoftware.Steam/pull/1086

@kisak-valve
Copy link
Member

Re-reading this issue report, it should be noted that the common case where DRI_PRIME gets set is from the desktop environment seeing PrefersNonDefaultGPU=true in Steam's desktop shortcut. As a workaround, this can be set to false or removed to avoid this issue.

@TimTheOverlord
Copy link

TimTheOverlord commented Jun 16, 2023

Re-reading this issue report, it should be noted that the common case where DRI_PRIME gets set is from the desktop environment seeing PrefersNonDefaultGPU=true in Steam's desktop shortcut. As a workaround, this can be set to false or removed to avoid this issue.

Not sure if I necessarily executed the above workaround correctly, but I could not get it to work. What I was able to do was run Steam from the terminal with the argument -vgui and that successfully got Steam to open again. The only downside to the -vgui workaround is that the Friends UI fails to connect. Not sure if this is technically the appropriate workaround, but it worked for me.

My setup is Ubuntu 20.04 with Steam installed via the .deb package from here and I am opted into the Steam Beta releases.

@kisak-valve
Copy link
Member

Hello @TimTheOverlord, with regards to this issue report, running steam from the terminal should workaround the common case, unless you're setting DRI_PRIME globally somewhere. If you need to pass launch options to steam, then you're seeing a different issue.

@Slider-Whistle
Copy link

Hey all, I'm sure you guys are all still cracking at it either way, but I just wanted to mention there's a specific use case for users deliberately launching steam under the DRM_PRIME=1 variable.
There's power saving in general of course, but it's also a popular choice with users who utilise full GPU passthroughs to virtual machines, effectively allowing them to pass control of their GPU between the guest or host operating system on the fly, just depending on what they're doing with it (which game they're playing) at the time.

https://help.steampowered.com/en/faqs/view/145A-FE54-F37B-278A
^ This official article doesn't get as far into the motivations of it, but it basically outlines a NVidia-specific method of doing the exact same thing, and mentions the convenience of launching steam under the variable rather than setting it on a per-/every-game basis.

@Candyhands
Copy link

I have no clue what

Re-reading this issue report, it should be noted that the common case where DRI_PRIME gets set is from the desktop environment seeing PrefersNonDefaultGPU=true in Steam's desktop shortcut. As a workaround, this can be set to false or removed to avoid this issue.

Not sure if I necessarily executed the above workaround correctly, but I could not get it to work. What I was able to do was run Steam from the terminal with the argument -vgui and that successfully got Steam to open again. The only downside to the -vgui workaround is that the Friends UI fails to connect. Not sure if this is technically the appropriate workaround, but it worked for me.

My setup is Ubuntu 20.04 with Steam installed via the .deb package from here and I am opted into the Steam Beta releases.

'v-gui' argument is the only way to get Steam to launch for me as well. 'DRI_PRIME' and modifying 'PrefersNonDefaultGPU=true' do absolutely nothing

@jntesteves
Copy link

@Candyhands @TimTheOverlord are you guys by any chance using KDE or one of the other Qt-based DEs? If that's the case, besides removing PrefersNonDefaultGPU=true from Steam's .desktop file, you might also need to remove X-KDE-RunOnDiscreteGpu=true. Can you try removing both options from the desktop file and test if that solves the problem.

Note that this test might require a logoff/login or a reboot because DEs often have trouble live reloading .desktop files.

@Seb-Solon
Copy link

Seb-Solon commented Jun 17, 2023

Re-reading this issue report, it should be noted that the common case where DRI_PRIME gets set is from the desktop environment seeing PrefersNonDefaultGPU=true in Steam's desktop shortcut. As a workaround, this can be set to false or removed to avoid this issue.

Can confirm that changing /usr/share/applications/steam.desktop as described above works for me. I have a config quite close to OP

Operating System Version:
Debian GNU/Linux 12 (bookworm) (64 bit)
Kernel Version: 6.1.0-9-amd64
X Window Manager: GNOME Shell
Steam Runtime Version: steam-runtime_0.20230509.49499

Video Card:
Driver: AMD AMD Radeon RX 6950 XT (navi21, LLVM 15.0.6, DRM 3.49, 6.1.0-9-amd64)
Driver Version: 4.6 (Compatibility Profile) Mesa 22.3.6

@Candyhands
Copy link

@Candyhands @TimTheOverlord are you guys by any chance using KDE or one of the other Qt-based DEs? If that's the case, besides removing PrefersNonDefaultGPU=true from Steam's .desktop file, you might also need to remove X-KDE-RunOnDiscreteGpu=true. Can you try removing both options from the desktop file and test if that solves the problem.

Note that this test might require a logoff/login or a reboot because DEs often have trouble live reloading .desktop files.

I have done this, and no dice. I'm on xfce, so it's gtk based rather than qt based. Running 'steam-runtime --reset' fixed the problem for me, but only for once launch. When I closed it, I couldn't open it back up.

@mwprado
Copy link

mwprado commented Jun 18, 2023

Same problem here, with DRI_PRIME=1, steamwebhelper chash.

OS: Fedora release 38 (Thirty Eight) x86_64
Host: HP ProDesk 600 G1 SFF
Kernel: 6.3.8-200.fc38.x86_64
Resolution: 1920x1080
DE: GNOME 44.2
WM: Mutter
WM Theme: Adwaita
Theme: Adwaita [GTK2/3]
Icons: Adwaita [GTK2/3]
CPU: Intel i7-4770 (8) @ 3.900GHz
GPU: Intel HD Graphics
GPU: AMD ATI Radeon Pro WX 4100
Memory: 4059MiB / 11835MiB

@ndavd
Copy link

ndavd commented Jun 18, 2023

Removing PrefersNonDefaultGPU and X-KDE-RunOnDiscreteGpu from the .desktop file worked for me. Is there any drawback to that? That is, once this issue get solved, should I bother to add it again or not really?

@Milor123
Copy link

Milor123 commented Jun 26, 2024

Failed to load module: /usr/lib32/gio/modules/libgiolibproxy.so

are you sure your problem is the same as in this issue?

from the arch wiki, Finding missing runtime libraries, could you please share the output from this command?

$ cd ~/.steam/root/ubuntu12_32
$ file * | grep ELF | cut -d: -f1 | LD_LIBRARY_PATH=. xargs ldd | grep 'not found' | sort | uniq

and make sure you [re]install required libs. I remember when I used Arch I had to do something similar:

pacman -S lib32-fontconfig lib32-freetype2 lib32-gdk-pixbuf2 lib32-gtk2 lib32-libice lib32-libnm lib32-libpulse lib32-sdl2 lib32-libva lib32-libvdpau lib32-libudev0-shim lib32-openal lib32-libsm

Thank u very much bro, it apparently works well, after install and run your command for search file, it dont found errors, and now I've installared my steam beta and works.

NOTE IT WORK ONLY IF I RUN STEAM WITH THIS:

env -u SDL_VIDEODRIVER steam

Thank uuu bro !!!! If the error occurs again I will let you know.

@hypertxtc
Copy link

Currently still an issue, however I need Steam to launch with the dGPU in specific circumstances, like when using VR. If the Steam client is launched with the iGPU but you launch SteamVR with the dGPU (for example when using ALVR), you get this garbled mess. Launching games still works fine (as long as you run them with DRI_PRIME=1) so it's not a showstopper, just a bit annoying.

image

@perroboc
Copy link

Quick note: today Steam started presenting the same behaviour, and indeed it was because, somehow, the integrated GPU was enabled. Had to reboot to UEFI and disable it, and Steam started working as expected again.

Might have been the windows partition doing something to the UEFI config, I don't know.

@erenatas
Copy link

No idea about the relevance, but disabling integrated GPU on BIOS solved it for me.

System:
  Host: nobara.lab Kernel: 6.11.8-300.fc41.x86_64 arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.2.3 Distro: Fedora Linux 41 (KDE Plasma)
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: ProArt X670E-CREATOR WIFI v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 2506
    date: 10/28/2024
CPU:
  Info: 8-core model: AMD Ryzen 7 7700X bits: 64 type: MT MCP cache: L2: 8 MiB
  Speed (MHz): avg: 4799 min/max: 545/5573 cores: 1: 4799 2: 4799 3: 4799
    4: 4799 5: 4799 6: 4799 7: 4799 8: 4799 9: 4799 10: 4799 11: 4799 12: 4799
    13: 4799 14: 4799 15: 4799 16: 4799
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900
    XTX/7900 GRE/7900M] driver: amdgpu v: kernel
  Display: wayland server: Xwayland v: 24.1.4 compositor: kwin_wayland
    driver: N/A resolution: 1: 2560x1440 2: 1920x1080
  API: EGL v: 1.5 drivers: kms_swrast,radeonsi,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.2.7 renderer: AMD
    Radeon RX 7900 XTX (radeonsi navi31 LLVM 19.1.0 DRM 3.59
    6.11.8-300.fc41.x86_64)
  API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib,wayland
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 31 HDMI/DP Audio
    driver: snd_hda_intel
  Device-2: Advanced Micro Devices [AMD] Family 17h/19h HD Audio
    driver: snd_hda_intel
  Device-3: Audient iD4 driver: hid-generic,snd-usb-audio,usbhid type: USB
  API: ALSA v: k6.11.8-300.fc41.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.2.6 status: active
Network:
  Device-1: Intel 82599ES 10-Gigabit SFI/SFP+ Network driver: ixgbe
  IF: enp1s0 state: up speed: 10000 Mbps duplex: full mac: 00:1b:21:bc:9f:18
  Device-2: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    driver: mt7921e
  IF: wlp11s0 state: down mac: de:56:fe:88:28:d2
  Device-3: Intel Ethernet I225-V driver: igc
  IF: eno1 state: down mac: c8:7f:54:6a:3d:a0
  Device-4: Aquantia AQtion AQC113CS NBase-T/IEEE 802.3an Ethernet [Antigua
    10G] driver: atlantic
  IF: eno2 state: down mac: c8:7f:54:6a:44:70
Bluetooth:
  Device-1: Foxconn / Hon Hai Wireless_Device driver: btusb type: USB
  Report: btmgmt ID: hci0 state: up address: D8:80:83:9C:6F:14 bt-v: 5.2
Drives:
  Local Storage: total: 1.82 TiB used: 135.96 GiB (7.3%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 2TB size: 1.82 TiB
Partition:
  ID-1: / size: 1.82 TiB used: 135.53 GiB (7.3%) fs: btrfs dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 427.6 MiB (43.9%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 19.3 MiB (3.2%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 1.82 TiB used: 135.53 GiB (7.3%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 41.0 C mobo: 26.0 C gpu: amdgpu temp: 39.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 8
Info:
  Memory: total: 32 GiB note: est. available: 30.97 GiB used: 4.96 GiB (16.0%)
  Processes: 789 Uptime: 4m Shell: Zsh inxi: 3.3.36

@eons93
Copy link

eons93 commented Dec 11, 2024

experiencing this issue as well. Ever since switching from Nvidia to AMD

I made a post #11560 but was rightfully closed for duplication. Notes might still be helpful.

Would love to be able to run Steam properly.

@Milor123
Copy link

experiencing this issue as well. Ever since switching from Nvidia to AMD

I made a post #11560 but was rightfully closed for duplication. Notes might still be helpful.

Would love to be able to run Steam properly.

Bro, try add here more details of you error, how is you crash? logs or things that can help to understand your problem.

Try running the steam over your terminal, and paste your logs here.

@eons93
Copy link

eons93 commented Dec 11, 2024

Replying to #9383 (comment)

Sorry man, more info is in my original post linked in my first comment on this page. I'm new to linux and when I tried to get support from steam, they just pushed me to here. I don't know exactly whats logs you are looking for but happy to provide whatever you need but I need some instruction.

I assume you mean to run the steam command and copy/paste the output from terminal?

@Milor123
Copy link

Milor123 commented Dec 11, 2024

Replying to #9383 (comment)

Sorry man, more info is in my original post linked in my first comment on this page. I'm new to linux and when I tried to get support from steam, they just pushed me to here. I don't know exactly whats logs you are looking for but happy to provide whatever you need but I need some instruction.

I assume you mean to run the steam command and copy/paste the output from terminal?

What SO (distribution of linux) are u using?
Simply try show the basic, open a terminal and write, steam-native or steam-runtime or steam
(it should show a small log in your terminal while the steam is trying open and crash) or search in /home/<user>/.steam/error.log

and send file here and/or paste code in code format

@eons93
Copy link

eons93 commented Dec 12, 2024

Replying to #9383 (comment)

Ubuntu Distro

txt file with output attached when i run steam command.
steam dump 12-11-24.txt

As for that error.log, I do not see such a thing at that location

@chinoto
Copy link

chinoto commented Dec 12, 2024

@eons93 The Steam "icon" (.desktop file) sets a flag (PrefersNonDefaultGPU=true) that causes Steam to try to run on the performance GPU, but this causes a crash that Valve simply hasn't fixed yet.
Based on your post (#11560), Steam is working when run directly from a terminal, so just keep doing that or remove the flag from the .desktop file.
You mentioned "steam is behaving weirdly", but didn't go into any detail.

@Milor123
Copy link

Replying to #9383 (comment)

Ubuntu Distro

txt file with output attached when i run steam command. steam dump 12-11-24.txt

As for that error.log, I do not see such a thing at that location

just try test if work execute the command in terminal:

try both, see if either solves your problem, if not then your problem is probably something else.

PrefersNonDefaultGPU=true steam
and
PrefersNonDefaultGPU=false steam

@eons93
Copy link

eons93 commented Dec 12, 2024

@eons93 The Steam "icon" (.desktop file) sets a flag (PrefersNonDefaultGPU=true) that causes Steam to try to run on the performance GPU, but this causes a crash that Valve simply hasn't fixed yet. Based on your post (#11560), Steam is working when run directly from a terminal, so just keep doing that or remove the flag from the .desktop file. You mentioned "steam is behaving weirdly", but didn't go into any detail.

I see, then I will look into changing the flag and seeing if that fixes it. As for the other strangeness, I feel like there are a few things but the main one that comes to mind is that sometimes when I start a game, steam will try and shutdown (a steam styled window pops up saying "steam is shutting down" or something similar). I can play the game fine and nothing actually happens to the steam client. This might be tied to something else I'm noticing where the steam client will just close after I quit out of a game.

@eons93
Copy link

eons93 commented Dec 13, 2024

Replying to #9383 (comment)

Alright, changing the flag did not change anything. additionally tried running the commands Milor123 suggested and both commands worked just fine so whatever the issue is, its not that.

@Milor123
Copy link

Replying to #9383 (comment)

Alright, changing the flag did not change anything. additionally tried running the commands Milor123 suggested and both commands worked just fine so whatever the issue is, its not that.

Are you runing it in wayland?

you should try:
unset SDL_VIDEODRIVER; steam

@eons93
Copy link

eons93 commented Dec 14, 2024

Replying to #9383 (comment)

Like the command just like that? running steam from terminal always works. how could I add that to the .desktop file? just copy and paste that line (up until the ' ; ') ?

Edit: I confirmed, I am running wayland. I did some quick googling on that parameter you mentioned and tried adding the line SDL_VIDEODRIVER=x11 and SDL_VIDEODRIVER=wayland to no difference.

I dont see why it would be an issue but I'm opening the steam.desktop file and saving my changes without issue then running steam icon. Not closing text editor between changes, but only making and saving changes when steam is closed. Just want to confirm that isn't somehow not submitting the changes.

@chinoto
Copy link

chinoto commented Dec 14, 2024

Replying to #9383 (comment) @Milor123

PrefersNonDefaultGPU=true steam and PrefersNonDefaultGPU=false steam

Using PrefersNonDefaultGPU as an environment variable shouldn't do anything since it is meant to be handled by the desktop environment when used in a desktop entry file. When the DE detects that key, it will do one of many things to use the non-default GPU:

# for open source drivers
DRI_PRIME=1 application
# nvidia's proprietary driver
optirun application
optirun -b primus application
primusrun application
prime-run application
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia application
# possibly others 😬

@chinoto
Copy link

chinoto commented Dec 14, 2024

@eons93 If Steam is loading when launched from the terminal, but not from the desktop entry file, then I would assume you haven't removed the PrefersNonDefaultGPU line yet. Or are you having a different issue?

@eons93
Copy link

eons93 commented Dec 14, 2024

@eons93 If Steam is loading when launched from the terminal, but not from the desktop entry file, then I would assume you haven't removed the PrefersNonDefaultGPU line yet. Or are you having a different issue?

I think I am having a different issue. I removed that line and steam still isn't running properly.

Essentially what happens when I run Steam from the desktop icon, steam is running in the background but the window will only blink in and out of existence for a split second, reattempting to open the window every 5 seconds I would guess. This continues until I quit the process by right clicking the icon on the top bar of my screen. Below is my desktop file if thats of any help.
steam.txt

@chinoto
Copy link

chinoto commented Dec 15, 2024

Try removing X-KDE-RunOnDiscreteGpu=true as well?

@Milor123
Copy link

Milor123 commented Dec 15, 2024

Replying to #9383 (comment)

you need edit the file /etc/environment (I highly recommend this if it solved your problem, in linux there are a lot of games that will not work if you remove the “SDL”.)

sudo nano /etc/environment

add it:

SDL_VIDEODRIVER=unset

@eons93
Copy link

eons93 commented Dec 15, 2024

Replying to #9383 (comment)

Yep, this is the one that did it. Even had a backup of the steam.desktop file that was unaltered and used that.

So my question now is, was my issue caused by not performing a step when I swapped from Nvidia to AMD? Everything I saw prior to the swap was that AMD runs much better and that i would just need to uninstall the nvidia drivers before I swapped (I might have unisntalled them after though). Trying to get a lesson out of this, haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests