amdgpu: Enable OpenCL & HIP

This commit is contained in:
ItsDrike 2024-07-07 19:26:10 +02:00
parent b371662ad0
commit 0f76593d32
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -22,13 +22,24 @@ in
vulkan-extension-layer vulkan-extension-layer
]; ];
# Enable OpenGL hardware = {
hardware.graphics = { graphics = {
enable = true; enable = true;
# Enable OpenCL and AMDVLK # Enable AMDVLK (AMD's open-source Vulkan driver)
extraPackages = with pkgs; [ amdvlk ]; extraPackages = with pkgs; [ amdvlk ];
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
};
# OpenCL (Universal GPU computing API - not AMD specific)
# To check if this works, run: `nix run nixpkgs#clinfo` (after rebooting)
opengl.extraPackages = with pkgs; [rocmPackages.clr.icd];
}; };
# HIP (SDK that allows running CUDA code on AMD GPUs)
# Most software has the paths hard-coded
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
}; };
} }