NV Prime Render Offload- Performance and resolution issues with web technologies based Steam games ( Vampire Survivors- CrossCode- both Linux native)

As described in the title; with NV prime render offload ( __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json) those two games has abysmal performance and sharpness issues with my NV dgpu ( GTX 1050 4 GB ) while my igpu ( Intel HD 630 ) runs them flawlessly. Both games are relying on web based solutions as can be seen on SteamDB.

Vampire Survivors:

https://steamdb.info/depot/1794685/

CrossCode:

https://steamdb.info/depot/368343/

Reproduction steps:

  • Launch Steam with __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json, test the games mentioned here on NV dgpu.

  • After that go to Library on Steam, right click to game, Properties, Launch options: __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=mesa VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json %command% to test games with Intel igpu.

Game specific notes:

  • Vampire Survivors needs user to opt-in to Public Beta. Right click to game on Library, Properties, Betas. Opt-in to Public Beta there.

  • On the case of CrossCode even loading screen at the beginning of the game is painfully slow compared to when game runs on igpu.

Relevant issues for both games when they are on NV dgpu:

  • Incredibly bad performance
  • All around much blurrier experience compared to igpu

NV bug report sh output:

nvidia-bug-report.log.gz (1.1 MB)

You’re using the intel driver instead of modesetting for the igpu. I don’t think that’s really recommendable.

That has no effect on this issue in fact. As other apps ( demanding 3D games ) just works at full speed.

Does the game process appear as a graphics client in the list produced by ‘nvidia-smi pmon’ when you click to launch and play the game in Steam? In the list there will be some Steam clients there, initially connected, but you should expect to see the game’s own executable appear in the client list as well.

Nope, they don’t appear. Specifially those two games does it, other games are successfully running on dgpu and gets their processes listed in nvidia-smi pmon.

CrossCode:

Euro Truck Simulator 2 ( one of the other hundreds of games that works on dgpu normally) :

I have filed a bug 3799151 internally for tracking purpose, shall keep you updated on progress.

1 Like

Thanks for the screenshots. These games fall back to software rendering which explains the subpar performance. This is why you didn’t see the game process listed as an NVIDIA graphics client in your screenshots.

I’ve been looking at CrossCode which at least seems to be using a Chromium based web engine for rendering and the reason for falling back to software rendering is likely related to that. For example, in 2021, Chromium had known problems finding accelerated NVIDIA drivers under PRIME Render Offload due to strict sandboxing preventing access to some shared libraries. This was fixed, with the final patch going into Chromium source tree in late June 2021.

I have no visibility into CrossCode but maybe the game internally uses (or ends up using externally?) an older Chromium engine that does not have this fix. It’s also possible there are other restrictions (from the execution environment, Chromium, Steam, or something else) limiting what libraries and files the game engine can access. Nevertheless, the end result is that the game does not seem to find NVIDIA userspace drivers for PRIME Render Offload and then fails to initialize OpenGL/Vulkan accelerated graphics.

Based on the data I have so far I can’t tell where the root cause to this lies but it might be a good start to inform the game developer about this so as to at least let them make sure they’ve got this use case covered in their testing.