nixos-hardware/common/gpu/amd/default.nix

36 lines
866 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
options.hardware.amdgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
"loading `amdgpu` kernelModule at stage 1. (Add `amdgpu` to `boot.initrd.kernelModules`)"
) // {
default = true;
};
config = lib.mkMerge [
{
services.xserver.videoDrivers = lib.mkDefault [ "amdgpu" ];
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
amdvlk
];
hardware.opengl.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
2021-09-28 13:23:41 -04:00
hardware.opengl = {
driSupport = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
};
2022-03-16 12:01:29 -04:00
environment.variables.AMD_VULKAN_ICD = lib.mkDefault "RADV";
}
(lib.mkIf config.hardware.amdgpu.loadInInitrd {
boot.initrd.kernelModules = [ "amdgpu" ];
})
];
}