Steam & Nvidia GPU: can't make it work consistently

I just installed Tumbleweed on my brand new MSI gaming computer, with Intel Core i7 and hybrid Intel/Nvidia GPU.

My goal is to successfully launch Steam games on the GPU.

This thread relates which, where and how I got the drivers for my Nvidia GPU.
And this one tells the tale of Steam not having access to my audio (there isn’t much information there but it explains why I’m trying to use Flatpak: because the sound works, unlike with Zypper).

All in all, here’s the situation:

  • if I install Steam with Zypper, games work both native and with Proton v7 (I need to connect to EA Games for some, and it seems v7 is supposed to be better than the latest ones for that, or so it seems to me), but I have no sound;
  • if I install Steam with Flatpak, I can install and run any game successfuly on the GPU… so long as I don’t reboot. After a reboot, I can still launch Steam but games crash immediatly when I launch them (button goes from “Play” to “Cancel” to “Stop” and back to “Play” in less than 2 seconds).

Here are my installed Nvidia packages:

Here is some additionnal information about my setup:

>  switcherooctl list
                                                                              
Device: 0
  Name:        Intel Corporation Alder Lake-P GT1 [UHD Graphics]
  Default:     yes
  Environment: DRI_PRIME=pci-0000_00_02_0

Device: 1
  Name:        NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile]
  Default:     no
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only
>  cat .zshrc |grep nvidia
                                                                   
alias nvidia_gpu='__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only'
>  ls /usr/share/vulkan/icd.d/
                      
intel_hasvk_icd.i686.json    intel_icd.i686.json    radeon_icd.i686.json
intel_hasvk_icd.x86_64.json  intel_icd.x86_64.json  radeon_icd.x86_64.json

And finally, here’s how I launch Steam:

>  nvidia_gpu steam

… if installed with Zypper, or:

>  nvidia_gpu flatpak run com.valvesoftware.Steam

… if installed with Flatpak.

I know very little about hardware, or how Steam works on Linux, and even though I found other people having the same problem on other forums, I wasn’t able to fix mine based only on the information I got there… Thanks!

First note: I don’t use Steam and never have, so any advice I give is just generic sound advice and completely unrelated to Steam. It may be all wrong.

From your last thread and this one, it sounds like the Zypper version of Steam is more consistent, so I would say to start with that one. Uninstall Flatpak version, install Zypper version, since Zypper only has one problem (no sound) and not a crashing problem.

Second step: have you tested to see if you have sound from other things? I’m thinking things like online videos or music players?
Have you tried playing any music? (Clementine maybe?)
If you can’t get sound on videos, it may be a plugins problem or a sound codecs problem.

If all of the above sound tests work, then Steam is probably trying to send the sound to the wrong output. If you have an external monitor plugged in (I recall you said you did at one point), try unplugging it and seeing if you have sound with just laptop screen.
If so, it may be that Steam is trying to send output through an unexpected place, like graphics card, expecting speakers attached to monitor instead of separate speakers.

Some ideas to get you started figuring out what’s happening.

Cheers,
SisPenguin

Ok, so. I have removed every Steam-related Flatpak package from my system, and reinstalled Steam from Zypper. I tried a small game, it does launch but there’s no sound again. My sound works for everything except Steam. Even with everything unplugged…

My guess is that maybe Steam is sending audio to my graphic card? Since I launch Steam with

For everybody:

>  aplay -L

null
    Discard all samples (playback) or generate zero samples (capture)
speexrate
    Rate Converter Plugin Using Speex Resampler
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
default
    Default ALSA Output (currently PulseAudio Sound Server)
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output
sysdefault:CARD=sofhdadsp
    sof-hda-dsp, 
    Default Audio Device

@ultome you need to switch the system sound back to pipewire… this is the default for Tumbleweed…

And it is not related to the nvidia part, it’s the system sound (your intel sound) that needs to be used by steam…

Then run wpctl status

Could not connect to PipeWire

… even though I just ran:

>  sudo zypper in pipewire-pulseaudio pipewire-libjack-0_3 pipewire-alsa
>  systemctl --user start pipewire.service
>  systemctl --user enable pipewire.service
>  systemctl --user start wireplumber.service
>  systemctl --user enable wireplumber.service
>  systemctl reboot

I’m trying my best on my own but it seems I need a little help with this…

@ultome Ref: openSUSE:Pipewire - openSUSE Wiki

zypper in -f pipewire
systemctl --user enable --now pipewire.{socket,service}
>  sudo zypper in -f pipewire
>  systemctl --user enable --now pipewire.{socket,service}
>  systemctl reboot
>  wpctl status

Could not connect to PipeWire
systemctl --user status pipewire.socket
systemctl --user status pipewire.service
● pipewire.socket - PipeWire Multimedia System Sockets
     Loaded: loaded (/usr/lib/systemd/user/pipewire.socket; enabled; preset: enabled)
     Active: active (running) since Sun 2023-12-03 17:49:45 CET; 22min ago
   Triggers: ● pipewire.service
     Listen: /run/user/1000/pipewire-0 (Stream)
             /run/user/1000/pipewire-0-manager (Stream)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/pipewire.socket

Dec 03 17:49:45 sodade systemd[2041]: Listening on PipeWire Multimedia System Sockets.
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; preset: disabled)
     Active: active (running) since Sun 2023-12-03 17:49:45 CET; 24min ago
TriggeredBy: ● pipewire.socket
   Main PID: 2050 (pipewire)
      Tasks: 4 (limit: 4915)
     Memory: 14.0M
        CPU: 3.822s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─2050 /usr/bin/pipewire

Dec 03 17:49:45 sodade systemd[2041]: Started PipeWire Multimedia Service.
Dec 03 17:49:45 sodade pipewire[2050]: [0:02:56.321680721] [2050]  WARN IPAManager ipa_manager.cpp:154 N>
Dec 03 17:49:45 sodade pipewire[2050]: [0:02:56.321711072] [2050]  INFO Camera camera_manager.cpp:284 li>

@ultome The pipewire.service should not be enabled, it’s trigger by the socket.

systemctl --user disable pipewire.service

Logout/login and check the status, the pipewire service should be running and also wpctl status

▶ systemctl --user status pipewire.service     
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; preset: disabled)
     Active: active (running) since Sun 2023-12-03 18:23:50 CET; 1min 7s ago
TriggeredBy: ● pipewire.socket
   Main PID: 11933 (pipewire)
      Tasks: 4 (limit: 4915)
     Memory: 8.2M
        CPU: 116ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─11933 /usr/bin/pipewire

Dec 03 18:23:50 sodade systemd[11763]: Started PipeWire Multimedia Service.
Dec 03 18:23:50 sodade pipewire[11933]: [0:37:01.297898761] [11933]  WARN IPAManager ipa_manager.cpp:154>
Dec 03 18:23:50 sodade pipewire[11933]: [0:37:01.297926176] [11933]  INFO Camera camera_manager.cpp:284 >
▶ wpctl status
Could not connect to PipeWire

I’m sorry this is getting long and I feel like I’m wasting your time… Am I running wrong commands, or doing anything I shouldn’t? Do you need additionnal information?

@ultome Can you create a test user and login as that test user and check wpctl status.

Same result, “Could not connect to PipeWire”…

@ultome can you reboot then…

Sorry everything is the same after a reboot…

And;

systemctl --user status pipewire-pulse.service
systemctl --user status pipewire-pulse.socket

@ultome also zypper se -i pipewire

▶ sudo zypper se -i pipewire 
[sudo] password for root:

*Loading repository data...
Reading installed packages...

S  | Name                           | Summary                                                   | Type
---+--------------------------------+-----------------------------------------------------------+--------
i  | kpipewire-imports              | QtQuick bindings for kpipewire                            | package
i  | libKPipeWire5                  | PipeWire integration for KDE Plasma - main library        | package
i  | libKPipeWireDmaBuf5            | PipeWire integration for KDE Plasma - DMA-BUF support     | package
i  | libKPipeWireRecord5            | PipeWire integration for KDE Plasma - recording support   | package
i  | libpipewire-0_3-0              | A Multimedia Framework designed to be an audio and vide-> | package
i  | libpipewire-0_3-0-32bit        | A Multimedia Framework designed to be an audio and vide-> | package
i+ | pipewire                       | A Multimedia Framework designed to be an audio and vide-> | package
i+ | pipewire-alsa                  | PipeWire media server ALSA support                        | package
i  | pipewire-alsa-32bit            | PipeWire media server ALSA support                        | package
i  | pipewire-jack                  | PipeWire JACK implementation                              | package
i  | pipewire-libjack-0_3           | PipeWire libjack replacement libraries                    | package
i  | pipewire-modules-0_3           | Modules For PipeWire, A Multimedia Framework              | package
i  | pipewire-modules-0_3-32bit     | Modules For PipeWire, A Multimedia Framework              | package
i  | pipewire-pulseaudio            | PipeWire PulseAudio implementation                        | package
i  | pipewire-spa-plugins-0_2       | Plugins For PipeWire SPA                                  | package
i  | pipewire-spa-plugins-0_2-32bit | Plugins For PipeWire SPA                                  | package
i  | pipewire-spa-tools             | The PipeWire SPA Tools                                    | package
i  | pipewire-tools                 | The PipeWire Tools                                        | package

Are you running this command as user?

Yes. the symbol marks the beginning of the command.