2021-03-23 19:34:15 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2022-12-15 22:01:50 +01:00
|
|
|
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" ];
|
2021-03-23 19:34:15 +01:00
|
|
|
|
2022-12-15 22:01:50 +01:00
|
|
|
hardware.opengl.extraPackages = with pkgs; [
|
|
|
|
rocm-opencl-icd
|
|
|
|
rocm-opencl-runtime
|
|
|
|
amdvlk
|
|
|
|
];
|
2021-03-23 19:34:15 +01:00
|
|
|
|
2022-12-15 22:01:50 +01:00
|
|
|
hardware.opengl.extraPackages32 = with pkgs; [
|
|
|
|
driversi686Linux.amdvlk
|
|
|
|
];
|
2021-09-28 19:23:41 +02:00
|
|
|
|
2022-12-15 22:01:50 +01:00
|
|
|
hardware.opengl = {
|
|
|
|
driSupport = lib.mkDefault true;
|
|
|
|
driSupport32Bit = lib.mkDefault true;
|
|
|
|
};
|
2022-03-16 17:01:29 +01:00
|
|
|
|
2022-12-15 22:01:50 +01:00
|
|
|
environment.variables.AMD_VULKAN_ICD = lib.mkDefault "RADV";
|
|
|
|
}
|
|
|
|
(lib.mkIf config.hardware.amdgpu.loadInInitrd {
|
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
})
|
|
|
|
];
|
2021-03-23 19:34:15 +01:00
|
|
|
}
|