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

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

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

@perroboc
Copy link

this happened to me, after restarting. Steam would show a balck window and close it, repeatedly, not being able to show my library. Launching from console worked OK.

What worked for me is that I noticed that my iGPU (the one that comes with the CPU) was suddenly enabled after a restart. Disabling it, as it was at the moment of installation of Steam, fixed everything.

@cemkavuklu
Copy link

After @perroboc 's comment, I checked the BIOS and my iGPU was enabled as well (Ryzen 9 7950X3D). Just disable the stupid thing, and you are good to go without any modifications.

@OboTheHobo
Copy link

Lot of comments here so apologies if this has been said before, but I found a fix. If you can find a way to launch steam that works (for me launching it from console with the steam command works) and turn off Enable GPU accelerated rendering in web views in the interface setting it will work again if launched with DRI_PRIME=1 or, for me, from the application launcher in KDE.

@romeroFan6268
Copy link

Well, it appears that changing the two lines in the Steam setup to:

PrefersNonDefaultGPU=false
X-KDE-RunOnDiscreteGpu=false

Well, now it works only once and then quits for good. Steam will not open. I have no idea why. Perhaps it's the new update for Linux Mint, Steam, or both. I have no idea...

In short, the Panel Icon for Steam will not work right.

Also, the start menu application shortcut for Steam does not work either...

Thankfully, I can still get it to work by typing in "Steam" in the terminal, clicking the Steam desktop icon, or by right-clicking the Steam icon on the Panel and selecting "Settings." It will not open any other way (at least none that I know about).

Ay-ya-ya-ya-yai. Such a rigmarole trying to get Steam to work on Linux Mint, you know? Uffda... :(

It seems over time, Steam wants us to use their program less and less. I don't know why. A lot of us don't wanna switch to Ubuntu to run Steam. Plus, from what I've heard, some people are even having problems on there as well...

Even "Minigalaxy" (which is basically the Linux version for GOG Galaxy) does not have any issues opening up...

@Metalfyre
Copy link

Metalfyre commented May 18, 2024

Replying to #9383 (comment)

This seems to be a solution for me, as for now. But sometimes the issue comes back and the client remains invisible. So I hope this is more of a permanent solution. At least until it is properly fixed

Unfortunenately the problem came back.

@major-gnuisance
Copy link

major-gnuisance commented May 26, 2024

I wrote a script that automates setting up a workaround for this.

You can find it here: https://gist.github.com/major-gnuisance/4fad491e37c5ac7efa72f9473d4e95bd

It sets up a shim script that adds the -cef-disable-gpu flag when the DRI_PRIME environment variable is set and installs a modified steam.desktop to use it.
Tested on Fedora 40 Workstation, but I expect it to be nearly universally compatible.

@major-gnuisance
Copy link

@kisak-valve I see 2 issues here:

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.

Hear, hear!

Ideally, Steam itself would always prefer to use the default GPU, to conserve power, and help the user manage GPU preferences for games.

I'd suggest adding a "default GPU" setting, looking something like this:

  • Use system default (GPU0)
  • Ask every time
  • GPU0: Foobar Inc. 1000 Lite (Integrated GPU)
  • GPU1: Foobar Inc. 9001 Ultra (Discrete GPU)
  • GPU2: llvmpipe (LLVM 18.1.1, 256 bits) (Software rendering)

With an option to override the selection on a per-game basis, much like it works with Proton.

See the output of vulkaninfo --summary for inspiration.
Namely, the deviceName and deviceType keys.

@C-Higgins
Copy link

C-Higgins commented Jun 7, 2024

Lot of comments here so apologies if this has been said before, but I found a fix. If you can find a way to launch steam that works (for me launching it from console with the steam command works) and turn off Enable GPU accelerated rendering in web views in the interface setting it will work again if launched with DRI_PRIME=1 or, for me, from the application launcher in KDE.

Yes! This is the only thing that fixed it for me, on Fedora 40 KDE Plasma 6. I removed the variables from the desktop file, but it only worked once I also turned this off.
I don't know if my configuration needs both, or just the steam settings fix. I am not going to add the lines back to the desktop file to test it.

@HajimeSHARK
Copy link

Got a solution, not sure if this has already been posted, but I have a feeling that this is indeed a problem on valves end.
(Literally created this account to post this, because I spent the last 3hrs trying to figure this out, it is currently 02:17)

This started happening on my version of Kubuntu 24.04. Steam launched with an update pending, after the update, I completely lost the steam window and it would only launch from the terminal or by executing the launch script from the bin folder.

This is my fix in Kubuntu 24.04

Locate Steam.desktop (typically located in /usr/share/applications/ -or- /home/YourUsername/.local/share/applications/)
Right Click
Open with Kate
Scroll until you find PrefersNonDefaultGPU=true
Change =true to =false

(repeat this step for wherever you have the steam.desktop located)

This was able to fix my issue.

@retroDEG
Copy link

retroDEG commented Jun 20, 2024

Replying to #9383 (comment)

yep fixed it for me as well

@Milor123
Copy link

guys, nothing work for me, i am in kde plasma 6 in manjaro stable, with RTX 4070 in WAYLAND,

What things i've tried? there is the list:

  1. Running Steam from the terminal with the argument -vgui instead of starting it through the desktop shortcut.
  2. Removing or add PrefersNonDefaultGPU=true from the Steam .desktop file.
  3. Setting DRI_PRIME=0 or DRI_PRIME=none. or in 1
  4. Modifying a script to add the -cef-disable-gpu flag when the DRI_PRIME environment variable is set.
  5. Creating a workaround using a modified steam.desktop, which uses a shim script that adds the -cef-disable-gpu flag.
  6. Launching Steam from console with the steam command.
  7. -vgui or try --reset or delete steam folder from /home/noe/.local/share/Steam/

These solutions not work for me

could please something help me?

@cemkavuklu
Copy link

@Milor123

What CPU are you using?

@Milor123
Copy link

@Milor123

What CPU are you using?

CPU: Intel i5-14500 (20) @ 5.000GHz
GPU: Intel AlderLake-S GT1
GPU: NVIDIA GeForce RTX 4070
Steam client version (last installed from pacman today):
Distribution (Manjaro Linux x86_64 Kernel: 6.6.32-1-MANJARO):
Opted into Steam client beta?: No
Have you checked for system updates?: yes
Steam Logs: steam-logs.tar.gz
GPU: Nvidia RTX 4070 (As secundary gpu, the main is the iGPU, but it always worked well)

@cemkavuklu
Copy link

@Milor123

You need to disable your iGPU in the BIOS. That's the permanent solution.

@Milor123
Copy link

Milor123 commented Jun 26, 2024

@Milor123

You need to disable your iGPU in the BIOS. That's the permanent solution.

It not a solution for me, I need work with my GPU and use it for passthrought in many situations

I was playing for a long time this way.

my iGPU loads kde plasma and my steam games use my nvidia card, it was always working in the past without any problems..

there is no reason to change it, it is a steam error, steam should open as it normally did.

@perroboc
Copy link

Launching Steam from console with the steam command.

what's the output from this?

@Milor123
Copy link

Launching Steam from console with the steam command.

what's the output from this?

this

steam                      
steam.sh[159649]: Running Steam on manjarolinux 24.0.2 64-bit
steam.sh[159649]: STEAM_RUNTIME is enabled automatically
setup.sh[159722]: Steam runtime environment up-to-date!
steam.sh[159649]: Steam client's requirements are satisfied
[2024-06-25 20:44:26] Startup - updater built Jun 20 2024 17:13:49
[2024-06-25 20:44:26] Startup - Steam Client launched with: '/home/noe/.local/share/Steam/ubuntu12_32/steam' '-srt-logger-opened'
06/25 20:44:26 minidumps folder is set to /tmp/dumps
06/25 20:44:26 Init: Installing breakpad exception handler for appid(steam)/version(1718904662)/tid(159785)
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2024-06-25 20:44:26] Loading cached metrics from disk (/home/noe/.local/share/Steam/package/steam_client_metrics.bin)
[2024-06-25 20:44:26] Failed to load cached hosts file (File 'update_hosts_cached.vdf' not found), using defaults
[2024-06-25 20:44:26] Using the following download hosts for Public, Realm steamglobal
[2024-06-25 20:44:26] 1. https://cdn.steamstatic.com, /client/, Realm 'steamglobal', weight was 1, source = 'baked in'
[2024-06-25 20:44:26] Checking for update on startup
[2024-06-25 20:44:26] Checking for available updates...
[2024-06-25 20:44:26] Downloading manifest: https://cdn.steamstatic.com/client/steam_client_ubuntu12
[2024-06-25 20:44:26] Manifest download: send request
[2024-06-25 20:44:27] Manifest download: waiting for download to finish
[2024-06-25 20:44:27] Manifest download: finished
[2024-06-25 20:44:27] Download skipped: /client/steam_client_ubuntu12 version 1718904662, installed version 1718904662, existing pending version 0
[2024-06-25 20:44:27] Nothing to do
[2024-06-25 20:44:27] Verifying installation...
[2024-06-25 20:44:27] Performing checksum verification of executable files
[2024-06-25 20:44:28] Verification complete
UpdateUI: skip show logo
Steam logging initialized: directory: /home/noe/.local/share/Steam/logs

/home/noe/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /usr/lib32/libproxy/libpxbackend-1.0.so)
Failed to load module: /usr/lib32/gio/modules/libgiolibproxy.so
XRRGetOutputInfo Workaround: initialized with override: 0 real: 0xebcaadc0
XRRGetCrtcInfo Workaround: initialized with override: 0 real: 0xebca9500
CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize
Couldn't initialize SDL: wayland  not available
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 159951
bus_name=com.steampowered.PressureVessel.LaunchAlongsideSteam
Couldn't initialize SDL: wayland  not available

@perroboc
Copy link

perroboc 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

@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

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