fix
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
#};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.nvtop-nvidia
|
||||
(pkgs.nvtopPackages.nvidia or pkgs.nvtop-nvidia)
|
||||
] ++ lib.optionals config.hardware.nvidia.prime.offload.enable [
|
||||
(pkgs.writeShellScriptBin "prime-run" ''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, options, ... }: lib.mkMerge [
|
||||
{
|
||||
# assumes common-gpu-amd from nixos-hardware is also added
|
||||
# TODO: should we move it from flake.nix to here?
|
||||
@@ -10,28 +10,56 @@
|
||||
|
||||
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
|
||||
nixpkgs.config.rocmSupport = true;
|
||||
nixpkgs.config.vdpauSupport = true;
|
||||
nixpkgs.config.vaapiSupport = true;
|
||||
nixpkgs.config.vdpauSupport = true;
|
||||
nixpkgs.config.vaapiSupport = true;
|
||||
|
||||
# nixos-hardware common-amd options
|
||||
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
||||
}
|
||||
# nixos-hardware common-amd options
|
||||
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
||||
(lib.mkIf (options ? hardware.amdgpu.opencl.enable) {
|
||||
hardware.amdgpu.opencl.enable = lib.mkDefault true;
|
||||
})
|
||||
(lib.mkIf (!options ? hardware.amdgpu.opencl.enable) {
|
||||
hardware.amdgpu.opencl = lib.mkDefault true;
|
||||
hardware.amdgpu.amdvlk = lib.mkDefault false;
|
||||
|
||||
})
|
||||
(lib.mkIf (options ? hardware.amdgpu.amdvlk.enable) {
|
||||
#hardware.amdgpu.amdvlk.enable = lib.mkDefault true;
|
||||
#hardware.amdgpu.amdvlk.support32Bit.enable = lib.mkDefault 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 (default in nixos-hardware)
|
||||
|
||||
# https://nixos.wiki/wiki/AMD_GPU#HIP
|
||||
# https://wiki.nixos.org/wiki/AMD_GPU#HIP
|
||||
systemd.tmpfiles.rules = let
|
||||
hip = if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11")
|
||||
then pkgs.hip
|
||||
else pkgs.rocmPackages.clr;
|
||||
in [
|
||||
"L+ /opt/rocm/hip - - - - ${hip}"
|
||||
rocmEnv = pkgs.symlinkJoin {
|
||||
name = "rocm-combined";
|
||||
paths = with pkgs.rocmPackages; [
|
||||
rocblas
|
||||
hipblas
|
||||
clr
|
||||
];
|
||||
};
|
||||
in [ "L+ /opt/rocm - - - - ${rocmEnv}" ];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(prev: final: {
|
||||
blender = prev.blender-hip;
|
||||
})
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtop-amd
|
||||
# enable opencl on polaris, (rx580)
|
||||
environment.variables.ROC_ENABLE_PRE_VEGA = "1";
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.nvtopPackages.amd or pkgs.nvtop-amd)
|
||||
pkgs.lact
|
||||
];
|
||||
|
||||
# lact - amdgpu GUI tool
|
||||
systemd.packages = [ pkgs.lact ];
|
||||
systemd.services.lactd.enable = true;
|
||||
systemd.services.lactd.wantedBy = [ "multi-user.target" ]; # add this if you want the unit to auto start at boot time
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user