This commit is contained in:
2023-06-19 02:45:50 +02:00
parent d6f9b79097
commit b78ba78296
7 changed files with 35 additions and 11 deletions

View File

@@ -5,7 +5,7 @@
# https://nixos.wiki/wiki/Nvidia
nixpkgs.config.cudaSupport = true;
#nixpkgs.config.cudaSupport = true; # TODO: TOO SLOW, BREAKS
nixpkgs.config.allowUnfreePredicate = pkg: lib.any (x: x) [
(lib.hasInfix "nvidia" (lib.toLower (lib.getName pkg)))
(lib.hasInfix "cuda" (lib.toLower (lib.getName pkg)))
@@ -28,7 +28,7 @@
environment.systemPackages = with pkgs; ([
nvtop
] ++ lib.optional hardware.nvidia.prime.offload.enable [
] ++ lib.optional config.hardware.nvidia.prime.offload.enable [
(writeShellScriptBin "prime-run" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0

View File

@@ -5,11 +5,12 @@
# https://libreddit.noximilien.pbsds.net/r/archlinux/comments/nih9c9/amdgpu_vs_modesetting_in_current_510_kernels_xorg/
nixpkgs.config.rocmSupport = true;
hardware.opengl.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ]; # use gpu, adaptive sync and and hardware page flipping
#services.xserver.videoDrivers = [ "modesetting" ]; # integrated (non-accelerated) framebuffer, KMS
nixpkgs.config.rocmSupport = true;
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];