mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Hardware/AMD] Add performance tuning + rocm-smi
Enable amdgpu support for two new class of GPUs Enable freesync Use new GPU scheduler if unsafeOptimizations is enabled Add amdvlk for vulkan support Allow to use proprietary AMD drivers if the user so wishes
This commit is contained in:
parent
0da55b8288
commit
9cbbc8ec6f
1 changed files with 28 additions and 7 deletions
|
|
@ -2,27 +2,48 @@
|
|||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.hardware.amd;
|
||||
generalCfg = config.aviallon.general;
|
||||
in
|
||||
{
|
||||
options.aviallon.hardware.amd = {
|
||||
enable = mkEnableOption "AMD gpus";
|
||||
useProprietary = mkEnableOption "Use proprietary AMDGPU Pro";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
aviallon.boot.cmdline = {}
|
||||
aviallon.boot.cmdline = {
|
||||
# for Southern Islands (SI ie. GCN 1) cards
|
||||
// { "radeon.si_support" = 0;
|
||||
"amdgpu.si_support" = 1; }
|
||||
"radeon.si_support" = 0;
|
||||
"amdgpu.si_support" = 1;
|
||||
# for Sea Islands (CIK ie. GCN 2) cards
|
||||
// { "radeon.cik_support" = 0;
|
||||
"amdgpu.cik_support" = 1; }
|
||||
;
|
||||
"radeon.cik_support" = 0;
|
||||
"amdgpu.cik_support" = 1;
|
||||
"amdgpu.freesync_video" = 1;
|
||||
"amdgpu.mes" = mkIf generalCfg.unsafeOptimizations 1;
|
||||
};
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
environment.systemPackages = with pkgs; [
|
||||
rocm-smi
|
||||
];
|
||||
|
||||
services.xserver.videoDrivers = []
|
||||
++ optional cfg.useProprietary "amdgpu-pro"
|
||||
++ [
|
||||
"amdgpu"
|
||||
"radeon"
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; mkIf (!cfg.useProprietary) [
|
||||
rocm-opencl-icd
|
||||
rocm-opencl-runtime
|
||||
amdvlk
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; mkIf (!cfg.useProprietary) [
|
||||
amdvlk
|
||||
mesa
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue