ArkanosisNet / aoe2.arkanosis.net

Tools for Age of Empires II
https://aoe2.arkanosis.net/
ISC License
8 stars 2 forks source link

Linux: Cleaner approach for selecting Vulkan drivers on Optimus laptops #5

Open Somrlik opened 9 months ago

Somrlik commented 9 months ago

You suggest renaming the driver discovery file for Intel or uninstalling the Intel Vulkan driver. This is usually unnecessary, since you can

  1. Force which Vulkan driver to use with env variable VK_ICD_FILENAMES
  2. Specify which GPU to use if running PRIME using env variable __GLX_VENDOR_LIBRARY_NAME (but only when using X11 I think)

Specifically, launch options in steam would look like

  1. VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.x86_64.json %command% (or the radeon ICD in the section below)
  2. __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%

The first approach is (at least for me) more reliable and works most of the time (for me).

I also noticed your TODO in that section, tried it but sadly did nothing for me.

I am not submitting as a PR, since more research is probably needed, Optimus and PRIME are pretty finicky with Proton. Works on my machine™.

Thank you for the docs, beautiful work!


Sources:

Arkanosis commented 6 months ago

Hi @Somrlik !

Thanks a lot for your thorough message and sorry for not having answered earlier. Somehow I wasn't receiving any notification for issues opened on the repositories of my own organization… that should be fixed now.

I really like the approach you suggest! The ones I discuss in the guide are really ugly but I've never managed to figure out a better way (mainly because I'm not facing the issue anymore, so it's impossible for me to tell whether a “fix” is working or not). There's has never been a valid reason to restrict what someone can do with their GPUs, just to be able to play a game, so from now on, I'll suggest your approach instead.

The TODO you mention (using DXVK_FILTER_DEVICE_NAME) was something I've seen a couple of people use (and have not been able to validate either), but I'm not sure it would have helped with the ICD problem anyway. It could still be useful to chose which GPU to use, but people could have to use both variables at the same time, eg. DXVK_FILTER_DEVICE_NAME="AMD Radeon RX 6600" VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json %command% (first variable to chose the GPU, second variable to chose the ICD).

I'll keep this issue open until if update the guide and close it just after.

Thanks again!