csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

CS2 refuses to launch with discrete graphics card

Open dc03 opened this issue 3 years ago • 6 comments

Your system information

  • System information from steam (Steam -> Help -> System Information) in a gist: https://gist.github.com/dc03/3f20f941e0e0c4d88e426f490219988e
  • Have you checked for system updates?: [Yes/No] Yes, everything is up to date.

Please describe your issue in as much detail as possible:

Describe what you expected should happen and what did happen. Please link any large pastes as a Github Gist.

I have a laptop with switchable graphics, with an AMD Renoir iGPU and an NVIDIA GTX 1650 as the discrete GPU (running Pop!_OS 22.04 LTS). The bumblebee service is disabled, though it makes no difference either way.

Expected: Able to launch the game using the discrete GPU when using either "NVIDIA Graphics" or "Hybrid Graphics", using the "Launch using discrete graphics card" option from the Pop!_OS launcher or using optirun/primusrun/pvkrun etc.

Actual:

  • On "Hybrid Graphics": Trying to launch the game using optirun/primusrun/pvkrun etc. does nothing, the "STOP" button shows up in steam for a moment or two and then reverts back to "PLAY". Copying the command that steam runs and running it in a console causes no output anywhere. Trying to use the environment variables __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia to launch the game causes it to skip the discrete GPU and it just uses the iGPU.
  • On "NVIDIA Graphics": The game launches, but kinda, as it doesn't show up on nvtop and doesn't do anything (just gets stuck showing me a screenshot of the desktop effectively).

Steps for reproducing this issue:

  1. Acquire a laptop with an AMD iGPU and an NVIDIA dGPU.
  2. Install Pop!_OS 22.04 LTS.
  3. Try to launch the game with the discrete GPU.

dc03 avatar Oct 01 '23 11:10 dc03

Hello @dc03, give the workaround at https://github.com/ValveSoftware/csgo-osx-linux/issues/3340#issuecomment-1741781041 a try.

kisak-valve avatar Oct 01 '23 13:10 kisak-valve

Hello @dc03, give the workaround at #3340 (comment) a try.

Hi, so the command would be something like VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json optirun %command% -vulkan, right? Unfortunately, still no dice.

I suspect it is because nvidia_icd.json does not actually exist:

>> ls /usr/share/vulkan/icd.d
intel_hasvk_icd.i686.json    intel_icd.i686.json    lvp_icd.i686.json    nvidia_icd.disabled_by_nv_vulkan_wrapper  radeon_icd.i686.json
intel_hasvk_icd.x86_64.json  intel_icd.x86_64.json  lvp_icd.x86_64.json  nv_vulkan_wrapper.json                    radeon_icd.x86_64.json

EDIT: Also, using nvidia_icd.disabled_by_nv_vulkan_wrapper and nv_vulkan_wrapper.json does not work either...

dc03 avatar Oct 01 '23 13:10 dc03

For something like nvidia_icd.disabled_by_nv_vulkan_wrapper to exist as a renamed nvidia_icd.json, there's something profoundly wrong with the design of whatever renamed that file. I'm guessing that was done by primus_vk, but I'm not particularly familiar with that software.

Please copy the contents of Steam Runtime Diagnostics from Steam (Steam -> Help -> Steam Runtime Diagnostics) and put it in a gist, then include a link to the gist in this issue report.

kisak-valve avatar Oct 01 '23 14:10 kisak-valve

For something like nvidia_icd.disabled_by_nv_vulkan_wrapper to exist as a renamed nvidia_icd.json, there's something profoundly wrong with the design of whatever renamed that file. I'm guessing that was done by primus_vk, but I'm not particularly familiar with that software.

Please copy the contents of Steam Runtime Diagnostics from Steam (Steam -> Help -> Steam Runtime Diagnostics) and put it in a gist, then include a link to the gist in this issue report.

Here you go: https://gist.github.com/dc03/3e226a66e7e11de8c18c76cf50904e04

dc03 avatar Oct 01 '23 14:10 dc03

Thanks, that helps clarify that bumblebee and/or primus_vk is actively interfering with access to Vulkan on you NVIDIA GPU. This is something to follow up on their side.

kisak-valve avatar Oct 01 '23 14:10 kisak-valve

Thanks, that helps clarify that bumblebee and/or primus_vk is actively interfering with access to Vulkan on you NVIDIA GPU. This is something to follow up on their side.

Yup, it was primus_vk (as it sets up the file rename as per apt). Uninstalling the following packages fixed the issue:

nvidia-primus-vk-common
nvidia-primus-vk-wrapper
primus-vk

And now the game runs basically perfectly with this:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%

Thanks for helping me out with this!

dc03 avatar Oct 01 '23 15:10 dc03