Offload rendering to Thunderbolt GPU

Offload rendering to Thunderbolt GPU

Offloading rendering to a Thunderbolt eGPU (NVIDIA)

Use PRIME Render Offload to render on an external NVIDIA GPU connected via Thunderbolt, while displaying on the internal screen.

Goal

Render apps on the external NVIDIA GPU and display the frames on the integrated GPU without switching the whole X session to NVIDIA.

Prerequisites

Quick command (one-off)

Run an app on the eGPU with PRIME offload:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <your_command>

Examples:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo -B
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia firefox

On Wayland with Vulkan apps, add the Vulkan layer variable:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only <your_command>

Verify it is using the eGPU

Optional: create a helper

Add a small wrapper to run anything on the eGPU.

Create ~/bin/egpu-run and make it executable:

mkdir -p ~/bin
cat > ~/bin/egpu-run <<'EOF'
#!/usr/bin/env bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
EOF
chmod +x ~/bin/egpu-run

Usage:

egpu-run blender
egpu-run steam

Troubleshooting

Notes