Run a specific application on the dGPU with PRIME render offload
Symptom
A game or GPU app runs at a fraction of expected speed on a hybrid laptop. glxinfo | grep "OpenGL renderer" reports the Intel/AMD iGPU even though an NVIDIA card is present, and nvidia-smi shows no processes.
Cause
On a PRIME offload setup the iGPU is the primary renderer by design. Applications only use the dGPU when they are explicitly offloaded with the right GLVND/Vulkan environment variables.
Fix
sudo pacman -S --needed nvidia-prime
# quick check
prime-run glxinfo | grep "OpenGL renderer"
prime-run vulkaninfo | head
prime-run is just a wrapper for these variables. Use them directly when you cannot prefix the command:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <command>
For a Steam title, set the launch options to:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%
If you globally forced Mesa for power saving (see the RTD3 record), you must also override the ICD lists for offloaded apps:
__NV_PRIME_RENDER_OFFLOAD=1 \
__GLX_VENDOR_LIBRARY_NAME=nvidia \
__VK_LAYER_NV_optimus=NVIDIA_only \
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json \
<command>
If you have bumblebee installed, remove it, because it blacklists nvidia_drm, which offloading requires:
sudo pacman -Rns bumblebee
Verify
prime-run glxinfo | grep "OpenGL renderer" names your NVIDIA GPU, and nvidia-smi lists the process while it runs.