-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
965dcad
commit 5521adb
Showing
5 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
let | ||
cfg = config.hardware.amdgpu; | ||
in { | ||
options.hardware.amdgpu = { | ||
legacySupport.enable = lib.mkEnableOption ''support for old AMD graphics cards, | ||
this uses `amdgpu` instead of `radeonsi` driver for Southern Islands (Radeon HD 7000) | ||
series and Sea Islands (Radeon HD 7000) series cards. | ||
Note: this does NOT add support for analog video output graphics cards. | ||
''; | ||
initrd.enable = lib.mkEnableOption ''loading `amdgpu` kernelModule in stage 1. | ||
Enable this to fix lower resolution in boot screen during initramfs phase. | ||
''; | ||
rocm.enable = lib.mkEnableOption ''ROCm/OpenCL support''; | ||
# cfg.amdvlk option is defined in ./amdvlk.nix module | ||
}; | ||
|
||
config = { | ||
boot.kernelParams = lib.optionals cfg.legacySupport.enable [ | ||
"amdgpu.si_support=1" | ||
"amdgpu.cik_support=1" | ||
"radeon.si_support=0" | ||
"radeon.cik_support=0" | ||
]; | ||
|
||
boot.initrd.kernelModules = lib.optionals cfg.initrd.enable [ "amdgpu" ]; | ||
|
||
hardware.opengl = lib.mkIf cfg.rocm.enable { | ||
enable = lib.mkDefault true; | ||
driSupport = lib.mkDefault true; | ||
extraPackages = [ | ||
pkgs.rocmPackages.clr | ||
pkgs.rocmPackages.clr.icd | ||
]; | ||
}; | ||
}; | ||
|
||
meta = { | ||
maintainers = with lib.maintainers; [ johnrtitor ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters