Files

24 lines
1.4 KiB
Plaintext

# Sourced by uwsm before Hyprland starts.
# Keep Hyprland on the AMD iGPU (Radeon 8060S, PCI c4:00.0). The Thunderbolt
# eGPU (RTX 5060 Ti) drives no displays and is for compute only; without this,
# aquamarine opens it as a second KMS device. cardN numbering shifts with eGPU
# hotplug timing, so resolve the stable by-path link. Left unset if missing so
# Hyprland still falls back to auto-detection.
igpu=$(readlink -f /dev/dri/by-path/pci-0000:c4:00.0-card 2>/dev/null)
[ -e "$igpu" ] && export AQ_DRM_DEVICES="$igpu"
unset igpu
# EGL through Mesa only, for Hyprland and every app in the session. glvnd
# otherwise tries NVIDIA's vendor first (10_nvidia.json sorts before
# 50_mesa.json), so the compositor and GL apps open /dev/nvidiactl even
# though they render on the iGPU; when the eGPU drops off the bus, they
# would be holding it. CUDA does not go through EGL and is unaffected.
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
# Vulkan through RADV only, same reasoning. The eGPU exists for LM Studio's
# CUDA backend; its Vulkan backend surveying the NVIDIA ICD on first start
# took the machine down (platform reset, no log) while CUDA work on the same
# card (voxtype/parakeet) runs fine. Games and every other Vulkan app stay
# on the iGPU. CUDA does not go through the Vulkan loader.
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.json