nixos-lib/hardware/amd.nix
Antoine Viallon 4d01393e59
[Hardware/GPUs] Refactor GPU related options
[Hardware/NVidia] Add option to save all VRAM before going to sleep
2022-05-17 09:19:04 +02:00

28 lines
633 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.aviallon.hardware.amd;
in
{
options.aviallon.hardware.amd = {
enable = mkEnableOption "AMD gpus";
};
config = mkIf (cfg.enable) {
boot.initrd.kernelModules = [ "amdgpu" ];
aviallon.boot.cmdline = {}
# for Southern Islands (SI ie. GCN 1) cards
// { "radeon.si_support" = 0;
"amdgpu.si_support" = 1; }
# for Sea Islands (CIK ie. GCN 2) cards
// { "radeon.cik_support" = 0;
"amdgpu.cik_support" = 1; }
;
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
];
};
}