feat: amd stuff

This commit is contained in:
2024-04-03 22:09:56 +02:00
parent bd1d0cfab6
commit e44948405a
9 changed files with 52 additions and 58 deletions

View File

@@ -0,0 +1,32 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.hardware.amdgpu.preset.default;
in {
options.hardware.amdgpu.preset.default = {
enable =
mkEnableOption "Enable ADM GPU driver support with some sane defaults";
};
config = mkIf cfg.enable {
hardware.opengl = {
enable = true;
driSupport = true;
extraPackages = with pkgs; [ rocmPackages.clr.icd ];
};
boot = {
# https://docs.kernel.org/gpu/amdgpu/module-parameters.html
kernelParams = [ "amdgpu.seamless=1" "amdgpu.freesync_video=1" ];
initrd.kernelModules = [ "amdgpu" ];
};
environment.systemPackages = with pkgs; [
amdgpu_top
glxinfo
libva-utils
vulkan-tools
];
};
}