From 3d3d29a83c3883d17139cceda5e7a081d03fea5a Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Mon, 4 Nov 2024 20:54:18 -0500 Subject: [PATCH] move GPU notes --- hosts/levi/gpu_notes.txt | 62 ++++++++++++++++++++++++++++++++++++ hosts/levi/xorg.nix | 69 ---------------------------------------- 2 files changed, 62 insertions(+), 69 deletions(-) create mode 100644 hosts/levi/gpu_notes.txt diff --git a/hosts/levi/gpu_notes.txt b/hosts/levi/gpu_notes.txt new file mode 100644 index 0000000..0cab21a --- /dev/null +++ b/hosts/levi/gpu_notes.txt @@ -0,0 +1,62 @@ +{ +hardware.nvidia.prime.intelBusId = "PCI:0:2:0"; +hardware.nvidia.prime.nvidiaBusId = "PCI:1:0:0"; +} + +### Nothing here has been tested since 2022 + +################################################################################ + +### "sync mode" +# +# good: +# max performance on external displays +# no BIOS settings change needed +# +# bad: +# graphics performance overhead on internal display +# internal display capped at 60hz +# +# hardware.nvidia.prime.sync.enable = true; +# hardware.nvidia.modesetting.enable = true; +# services.xserver.displayManager.gdm.wayland = false; +# services.xserver.videoDrivers = [ "nvidia" ]; +# # xrandr workaround for laptop panel not showing up with GDM. Reference: +# # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix +# services.xserver.displayManager.sessionCommands = '' +# ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0 +# ''; + +################################################################################ + +### nvidia drivers disabled +# +# Not well tested. Possibly Incomplete. +# Won't allow external displays connected to nvidia GPU. +# +# Shutting off Nvidia GPU would theoretically save power. +# I do not think this actually powers down the Nvidia GPU, just stops using it. +# +# boot.kernelParams = [ "module_blacklist=nouveau" ]; + +################################################################################ + +### hybrid graphics +# +# Not well tested. Possibly Incomplete. +# Won't allow external displays connected to nvidia GPU. +# +# Everything would use intel by default, +# but specific apps would run on the nvidia GPU under the script. +# +# hardware.nvidia.prime.offload.enable = true; +# services.xserver.videoDrivers = [ "nvidia" ]; +# environment.systemPackages = [ +# (pkgs.writeShellScriptBin "nv" '' +# 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 "$@" +# '') +# ]; diff --git a/hosts/levi/xorg.nix b/hosts/levi/xorg.nix index 55ab324..56633ec 100644 --- a/hosts/levi/xorg.nix +++ b/hosts/levi/xorg.nix @@ -1,16 +1,5 @@ { - hardware.nvidia.prime.intelBusId = "PCI:0:2:0"; - hardware.nvidia.prime.nvidiaBusId = "PCI:1:0:0"; - ### NVIDIA-only using MUX switch in BIOS. - # - # good: - # simple, always works. - # max performance everywhere. - # - # bad: - # requires BIOS setting changes, which is annoying. - # boot.kernelParams = [ "module_blacklist=i915" ]; services.xserver.displayManager.gdm.wayland = false; services.xserver.videoDrivers = [ "nvidia" ]; @@ -19,61 +8,3 @@ Option "metamodes" "DP-2: 2560x1440_165 +0+0 {AllowGSYNCCompatible=On}" ''; } - -### Nothing below this line has been tested since 2022 - -################################################################################ - -### "sync mode" -# -# good: -# max performance on external displays -# no BIOS settings change needed -# -# bad: -# graphics performance overhead on internal display -# internal display capped at 60hz -# -# hardware.nvidia.prime.sync.enable = true; -# hardware.nvidia.modesetting.enable = true; -# services.xserver.displayManager.gdm.wayland = false; -# services.xserver.videoDrivers = [ "nvidia" ]; -# # xrandr workaround for laptop panel not showing up with GDM. Reference: -# # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix -# services.xserver.displayManager.sessionCommands = '' -# ${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0 -# ''; - -################################################################################ - -### nvidia drivers disabled -# -# Not well tested. Possibly Incomplete. -# Won't allow external displays connected to nvidia GPU. -# -# Shutting off Nvidia GPU would theoretically save power. -# I do not think this actually powers down the Nvidia GPU, just stops using it. -# -# boot.kernelParams = [ "module_blacklist=nouveau" ]; - -################################################################################ - -### hybrid graphics -# -# Not well tested. Possibly Incomplete. -# Won't allow external displays connected to nvidia GPU. -# -# Everything would use intel by default, -# but specific apps would run on the nvidia GPU under the script. -# -# hardware.nvidia.prime.offload.enable = true; -# services.xserver.videoDrivers = [ "nvidia" ]; -# environment.systemPackages = [ -# (pkgs.writeShellScriptBin "nv" '' -# 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 "$@" -# '') -# ];