mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-08 06:33:54 +00:00
[Hardware/AMD] Move amd.nix into amd/default.nix
This commit is contained in:
parent
537b23cd39
commit
0b3ba6cea3
1 changed files with 20 additions and 18 deletions
|
|
@ -4,8 +4,8 @@ let
|
||||||
cfg = config.aviallon.hardware.amd;
|
cfg = config.aviallon.hardware.amd;
|
||||||
devCfg = config.aviallon.developer;
|
devCfg = config.aviallon.developer;
|
||||||
generalCfg = config.aviallon.general;
|
generalCfg = config.aviallon.general;
|
||||||
in
|
myMesa = pkgs.mesa;
|
||||||
{
|
in {
|
||||||
options.aviallon.hardware.amd = {
|
options.aviallon.hardware.amd = {
|
||||||
enable = mkEnableOption "AMD gpus";
|
enable = mkEnableOption "AMD gpus";
|
||||||
useProprietary = mkEnableOption "Use proprietary AMDGPU Pro";
|
useProprietary = mkEnableOption "Use proprietary AMDGPU Pro";
|
||||||
|
|
@ -16,6 +16,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
config = mkIf (cfg.enable) {
|
config = mkIf (cfg.enable) {
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
|
|
@ -26,9 +27,10 @@ in
|
||||||
# for Sea Islands (CIK ie. GCN 2) cards
|
# for Sea Islands (CIK ie. GCN 2) cards
|
||||||
"radeon.cik_support" = 0;
|
"radeon.cik_support" = 0;
|
||||||
"amdgpu.cik_support" = 1;
|
"amdgpu.cik_support" = 1;
|
||||||
"amdgpu.freesync_video" = 1;
|
|
||||||
"amdgpu.mes" = mkIf generalCfg.unsafeOptimizations 1;
|
|
||||||
"amdgpu.ppfeaturemask" = mkIf generalCfg.unsafeOptimizations "0xfff7ffff";
|
"amdgpu.ppfeaturemask" = mkIf generalCfg.unsafeOptimizations "0xfff7ffff";
|
||||||
|
"amdgpu.freesync_video" = 1;
|
||||||
|
#"amdgpu.mes" = mkIf generalCfg.unsafeOptimizations 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; []
|
environment.systemPackages = with pkgs; []
|
||||||
|
|
@ -37,8 +39,6 @@ in
|
||||||
]
|
]
|
||||||
++ optionals devCfg.enable ([]
|
++ optionals devCfg.enable ([]
|
||||||
++ [ rocminfo ]
|
++ [ rocminfo ]
|
||||||
++ optional (hasAttr "hipify-perl" pkgs) pkgs.hipify-perl
|
|
||||||
++ optional (hasAttr "tensorflow2-rocm" pkgs) pkgs.tensorflow2-rocm
|
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -51,23 +51,25 @@ in
|
||||||
|
|
||||||
programs.corectrl.enable = mkIf generalCfg.unsafeOptimizations true;
|
programs.corectrl.enable = mkIf generalCfg.unsafeOptimizations true;
|
||||||
|
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl = {
|
||||||
hardware.opengl.extraPackages = with pkgs; mkIf (!cfg.useProprietary) (mkAfter [
|
enable = true;
|
||||||
rocm-opencl-icd
|
package = with pkgs; myMesa.drivers;
|
||||||
rocm-opencl-runtime
|
extraPackages = with pkgs; mkIf (!cfg.useProprietary) (mkAfter [
|
||||||
mesa
|
rocm-opencl-icd
|
||||||
amdvlk
|
rocm-opencl-runtime
|
||||||
]);
|
(hiPrio myMesa)
|
||||||
|
amdvlk
|
||||||
|
]);
|
||||||
|
extraPackages32 = with pkgs.driversi686Linux; mkIf (!cfg.useProprietary) [
|
||||||
|
mesa
|
||||||
|
amdvlk
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
"AMD_VULKAN_ICD" = strings.toUpper cfg.defaultVulkanImplementation;
|
"AMD_VULKAN_ICD" = strings.toUpper cfg.defaultVulkanImplementation;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; mkIf (!cfg.useProprietary) [
|
|
||||||
mesa
|
|
||||||
amdvlk
|
|
||||||
];
|
|
||||||
|
|
||||||
# Make rocblas and rocfft work
|
# Make rocblas and rocfft work
|
||||||
nix.settings.extra-sandbox-paths = [
|
nix.settings.extra-sandbox-paths = [
|
||||||
"/dev/kfd?"
|
"/dev/kfd?"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue