nix/os-mods/amdgpu/default.nix

54 lines
1.2 KiB
Nix

{ config
, lib
, pkgs
, ...
}: {
boot = {
initrd.availableKernelModules = [ "amdgpu" ];
kernelModules = [ "amdgpu" ];
# kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
};
programs.corectrl = {
enable = true;
gpuOverclock.enable = true;
};
# services.xserver.videoDrivers = [ "amdgpu" ];
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
hardware.opengl = {
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
amdvlk
rocmPackages.rocm-runtime
rocmPackages.llvm.clang
rocm-opencl-icd
rocm-opencl-runtime
vaapiVdpau
libvdpau-va-gl
# libva1
obs-studio-plugins.obs-vaapi # TODO check if obs is enabled
gst_all_1.gstreamer
gst_all_1.gst-vaapi
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
driversi686Linux.vaapiVdpau
driversi686Linux.libvdpau-va-gl
];
};
# Force radv
environment.variables.AMD_VULKAN_ICD = "RADV";
environment.systemPackages = with pkgs; [
vulkan-tools
libva-utils
# nixgl.nixGLIntel
# nixgl.nixVulkanIntel
];
}