Game does not recognize dedicated nvidia optimus graphics using prime-run in Steam start options

Hi there,
I usually have no issues launching steam games with prime-run %command% on my nvidia optimus gaming laptop.
But now Marvel’s Spider-Man: Miles Morales is driving me nuts by ignoring the launch options and using intel graphics no matter what…
I have tried several iterations of start options and launching the game with or without the launcher, but the prime-run option seems to be ignored or does not make it to the start of the actual game.
Right now I use PROTON_ENABLE_NVAPI=1 VKD3D_CONFIG=dxr11 DXVK_ASYNC=1 prime-run %command% -nolauncher
The only working option I discovered is to launch Steam from the terminal with prime-run steam. The game launches with nvidia graphics in that case. But streaming the game with steam link does not work in this case, so this is not an option for me either.

Any thoughts on this?

I have one thought.

Up until very recently I was under the (incorrectly) understanding that by me using gamemoderun %command% it would use my dedicated GPU. I got questioned about that so after some testing, it turned out steam itself chooses my dedicated GPU no matter what I put in the launch options.
This is on my system, your might work completely different.

Try removing prime-run on a game that uses your dedicated GPU and see if it still does.
That way you know where to look, maybe its not prime-run related at all.

Thank you for your thoughts on this!

Meanwhile I found different launch options that force the use of the nvidia graphics and now everything works as intended.

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only -nolauncher

thats prime-run :sweat_smile:

Ok, that’s … interesting…

I wonder what the difference might be!? The “code” works, the “shortcut” does not.

There is none except you added -nolauncher at the end. :wink:

But that cannot be the issue. I tried several different launch settings. -nolauncher is just an argument to not start the game launcher. I definitely tried prime-run with and without launcher and there was no difference.

OK, I gave it another try: the difference is %command%. prime-run by itself works, but not with the usual %command% argument.
Does somebody have an explanation for this behaviour?

1 Like

What happens if you run ONLY with %command% and nothing else?
Is it the same as empty?

Er? It should be:

prime-run %command% -nolauncher

OK, you see me even more puzzled now. It works 1) without any argument and 2) with %command% only. The thing that does not work is prime-run %command%.

I was pretty sure that I tried it without launch options before and I thought it did not work. But maybe I tried to many options and did not realize it worked without any options…

Again, I think you look at this backwards.
I think it ignores prime-run all together.

Do 4 tests on a game that you know works “normally” (not spiderman)

  1. empty start argument
  2. only %command%
  3. only prime-run
  4. prime-run %command%

Note down the differences.
On my system all above starts with my dedicated gpu.

I think the arguments you pass (for spiderman) is for wine, not steam iteslf. But I am no expert in this, just very curious.

prime-run %command% -nolauncher is the usual way. But that does not work. It obviously works out of the box without any launch arguments and I did not get it…

1-3 do work, 4 does not.

And by “work” you mean your didicated gpu is used on all 3?

Yes, that is what I mean. Option 4 causes the use of the intel graphics.
And that is the exact opposite of how it usually works on my machine.

My theory is steam ignores prime run all together, but that does not explain why it fails with using prime-run %command%

If you close steam and open it again in a terminal (open terminal and type steam) then try to run a game with prime-run %command% it could be interesting to see what steam reports as errors.

Well, there where a lot of changes in Steam due to the rise of the Steam Deck. Probably there is more auto-detection going on.
But as I mentioned before: first game where these launch options lead to the exact opposite.

yes, witch is very strange. But I think the arguments you use instead for the spiderman game is for wine (or proton) directly somehow now.
As I said, it would be interesting to see the output. But you got it working and I understand if you want to play instead. :wink:

I am not sure what the terminal syntax would be exactly.