does rocm work yet?

This commit is contained in:
Peder Bergebakken Sundt 2023-11-10 22:54:26 +01:00
parent f1bf32d116
commit 370216d15c
1 changed files with 15 additions and 7 deletions

View File

@ -3,24 +3,32 @@
# assumes common-gpu-amd from nixos-hardware is also added # assumes common-gpu-amd from nixos-hardware is also added
# TODO: should we move it from flake.nix to here? # TODO: should we move it from flake.nix to here?
# nixos-hardware common-amd option # nixos-hardware common-amd options
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
hardware.amdgpu.opencl = true; hardware.amdgpu.opencl = true;
hardware.amdgpu.amdvlk = true;
hardware.opengl.enable = true;
# https://libreddit.noximilien.pbsds.net/r/archlinux/comments/nih9c9/amdgpu_vs_modesetting_in_current_510_kernels_xorg/
services.xserver.videoDrivers = [ "amdgpu" ]; # use gpu, adaptive sync and and hardware page flipping
#services.xserver.videoDrivers = [ "modesetting" ]; # integrated (non-accelerated) framebuffer, KMS
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = [
pkgs.rocm-opencl-icd
pkgs.rocm-runtime#-ext
];
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ? nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
nixpkgs.config.rocmSupport = true; nixpkgs.config.rocmSupport = true;
nixpkgs.config.vdpauSupport = true; nixpkgs.config.vdpauSupport = true;
nixpkgs.config.vaapiSupport = true; nixpkgs.config.vaapiSupport = true;
# https://nixos.wiki/wiki/AMD_GPU#HIP
hardware.opengl.enable = true;
# https://libreddit.noximilien.pbsds.net/r/archlinux/comments/nih9c9/amdgpu_vs_modesetting_in_current_510_kernels_xorg/
services.xserver.videoDrivers = [ "amdgpu" ]; # use gpu, adaptive sync and and hardware page flipping
#services.xserver.videoDrivers = [ "modesetting" ]; # integrated (non-accelerated) framebuffer, KMS
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}" "L+ /opt/rocm/hip - - - - ${pkgs.hip}"
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nvtop-amd nvtop-amd
]; ];