Nvidia optimus won't work with steam games

I have a Zephyrus m16 with an Intel i7-11800H and Nvidia 3050Ti.
For some reason steam games using proton don’t seem to work. This is using steam flatpak installed using KDE Discover. One game specifically complains about a lack of memory, the other just a black screen. I know these to work on Linux as I have had them running on PopOS on this machine, and on other Linux distros running on my desktop with AMD graphics.

Edit: I ended up trying the NVK driver, and this made one game work (Satisfactory), but the other is still broken (NieR: Automata). The performance also is not as good. Though I do appreciate having an open source driver and hope performance will improve as it matures. For now I want the proprietary driver.

Here are a few things to try.
Have you enabled discrete graphics on the steam shortcut?

Option 2: Have a look at the output of switcherooctl it should list 2 devices, one for your integrated graphics and one for your 3050Ti. Have a look at your environment variables and put that into your launch settings. It will probably look something like this in your launch settings for your game

__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only %command%

How did you get the bazzite-steam installed? I was trying to use the flatpak because I didn’t know there was a way to install it locally.

I’m running Bazzite but you can layer steam if you want but it’s a bit of a mission. Check if you have the “Run using dedicated graphics card” option as that would be the simplest. If not try option 2.

It’s already set to use dedicated graphics. I tried adding the arguments from switcherooctl to the launch options and it seemingly did nothing.

At this rate I think I will have to layer or start making custom images. I did try making a customized image of aurora with steam, but it seemed quite difficult.

If you run nvidia-smi while the game is running does it show the game in the tool?

Also If you going to make a custom image it might be easier starting with Bazzite and adding the dx tools you need. I found that it’s way easier adding VScode and docker than adding wine, steam, lutris and all that to Aurora.

Depends. Some times it will show in nvidia-smi and give blank screen or crash. Other times when I have run it, it will be absent from nvidia-smi and either not launch or launch on integrated. I’ve tried a few different configurations: both distro box and flatpak installs (on both ubuntu and fedora distroboxes); tried with and without proprietary drivers; different launch options, etc.

Only seems to work correctly when running bazzite instead of aurora.

I think you might be correct about making a custom image. The only difficulty with layering docker is going to be getting a repo installed which is made more difficult by the fact you can’t use normal rpm/dnf commands.

This was how I did it in my custom image https://github.com/wolfyreload/bazzite-dx/commit/8f44b171bd5ff3bf146cbe87eaa0e7cd9526d299 you effectively keep your .repo files in source control and copy them over in the container file. Borrowed a bunch of code from the bluefin/aurora project to get it working.

I have managed to put together a custom image. Now I am having issues getting it to build in GitHub actions. It seems to be running out of space after including the virtualization software. How did you fix this issue?

Yeah, in Bazzite they use this step to make more space before building the image

      # Cleanup space for the build
      - name: Maximize build space
        uses: ublue-os/remove-unwanted-software@v7

      # Build image using Buildah action
      - name: Build Image
        id: build_image
......

Thanks a million that made it work.

I know GitHub builds can cost money. Does yours cost you a lot or is it under some kind of free-tier?

I’m on the free tier, you are limited to 2000 git hub action build minutes per month for free which is quite generous. So you should be good unless github changes their pricing tiers.

1 Like