flake/nixos/hardware/gpu/amd.nix

26 lines
546 B
Nix
Raw Normal View History

2023-09-19 00:17:43 +00:00
{ pkgs, ... }:
# FOLLOWING https://nixos.wiki/wiki/AMD_GPU DIRECTLY
# I HAVE NO IDEA WHAT AM I DOING
{
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
# OpenCL
hardware.opengl = {
extraPackages = with pkgs; [
amdvlk
rocm-opencl-icd
rocm-opencl-runtime
];
# Only available on unstable
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
};
# HIP
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
}