我的硬件是 Lenovo Legion Y9000P,Intel Iris Xe 核显和 NVIDIA RTX 3060 独显。
Offload 模式
在 configuration.nix
中添加:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| { config, pkgs, ... }: let nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 export __GLX_VENDOR_LIBRARY_NAME=nvidia export __VK_LAYER_NV_optimus=NVIDIA_only exec "$@" ''; in {
nixpkgs.config.allowUnfree = true; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.prime = { offload.enable = true; intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; }; }
|
完成!