Sample Header Ad - 728x90

How to force Vulkan applications to NOT use Nvidia proprietary GPU?

1 vote
1 answer
1623 views
I have a laptop with two GPUs, a AMD integrated one and a headless Nvidia chip. According to [the Nvidia documentation](https://download.nvidia.com/XFree86/Linux-x86_64/515.86.01/README/primerenderoffload.html) , setting the environment variable __NV_PRIME_RENDER_OFFLOAD=1 will cause the Nvidia GPU to appear first to applications, __VK_LAYER_NV_optimus=NVIDIA_only will hide other GPUs, forcing applications to use the Nvidia one, and __VK_LAYER_NV_optimus=non_NVIDIA_only will hide Nvidia GPUs. The former option works fine, but the latter option only adjusts the order, instead of hiding anything:
$ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=non_NVIDIA_only vulkaninfo --summary | grep deviceName
        deviceName         = AMD Radeon Graphics (RADV RENOIR)
        deviceName         = NVIDIA GeForce RTX 3050 Ti Laptop GPU
        deviceName         = llvmpipe (LLVM 15.0.6, 256 bits)
$ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only vulkaninfo --summary | grep deviceName
        deviceName         = NVIDIA GeForce RTX 3050 Ti Laptop GPU
        deviceName         = AMD Radeon Graphics (RADV RENOIR)
        deviceName         = llvmpipe (LLVM 15.0.6, 256 bits)
Indeed, with the latter option set, many applications still default to the (higher-performance) Nvidia GPU:
$ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=non_NVIDIA_only vkcube
Selected GPU 1: NVIDIA GeForce RTX 3050 Ti Laptop GPU, type: DiscreteGpu
This is with Nvidia driver version 515.86.01, the one that currently ships with Debian testing. **How to get applications to only see the integrated GPU**?
Asked by whoKnows (138 rep)
Jun 4, 2023, 12:14 AM
Last activity: Jun 7, 2023, 03:53 PM