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 · 139 comments
Open

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

koresh-krasa opened this issue Apr 28, 2023 · 139 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?

@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.

@LinuxinaBit
Copy link

LinuxinaBit commented Jan 5, 2025

I'm having an identical issue.

Distro: Solus 4.6 Convergence
DE: Budgie
Window system: X11
GPU: AMD RX 6400
CPU: Intel Core i5-8500
System install (not Flatpak)

Running using either switcheroo-control (Prefers Non-Default GPU set to true in a .desktop file) or the DRI_PRIME=1 environment variable set in either a terminal or .desktop file causes Steam to start fine, show the login screen, then repeatedly display a transparent window that almost immediately closes.

When attempting to use the integrated Intel GPU, Steam works perfectly, but games run on the integrated GPU :(

Doing SDL_VIDEODRIVER=unset results in the message described here: #11608

Note that the DE and compositor are running on the integrated GPU.
Issue persists no matter what GPU the monitor is connected to.

2025-01-04.23-48-47.mp4

@ScarlettSamantha
Copy link

After some messing around in Kubuntu 24.10 I found a easy way to make it work like expected, if you go to the .desktop shortcut and do properties then click on run on dedicated gpu to disable it. It will boot fine and give no more issues.

(I have attached my screenshot on how to get it working on Kubuntu)

Image

@LinuxinaBit
Copy link

@ScarlettSamantha

if you go to the .desktop shortcut and do properties then click on run on dedicated gpu to disable it. It will boot fine and give no more issues.

Yes, this issue is discussing Steam crashing when that specific option is enabled. That option (effectively) sets DRI_PRIME through switcheroo-control.
Disabling it ‘fixes’ the problem because the problem only happens when that option (or others like it) are enabled ;)

@nathub
Copy link

nathub commented Feb 24, 2025

I am in Zorin OS.
I don't have that KDE menu, however I was able to fix it by editing my .desktop file (/usr/share/applications/steam.desktop).

PrefersNonDefaultGPU=true

I changed the above line from true to false. My system does have an iGPU, but for whatever reason this line needs to be false.

I had to restart my system for the change to take effect (though maybe you can just log out and log back in).

@LinuxinaBit
Copy link

LinuxinaBit commented Feb 24, 2025

@nathub

PrefersNonDefaultGPU=true

I changed the above line from true to false. My system does have an iGPU, but for whatever reason this line needs to be false.

This issue is discussing Steam crashing when that option is set to true. That option (effectively) sets DRI_PRIME through switcheroo-control.
Setting it to false ‘fixes’ the problem because the problem only happens when that option (or others like it) are enabled ;)

Edit: And yes I mostly copy-pasted this from my previous reply. Seems to be a commonly misunderstood subject 😁

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