mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
nixos/amdgpu: init module
This commit is contained in:
parent
23bcbb6dfd
commit
6a0b6a6b74
@ -549,6 +549,7 @@
|
||||
./services/games/xonotic.nix
|
||||
./services/hardware/acpid.nix
|
||||
./services/hardware/actkbd.nix
|
||||
./services/hardware/amdgpu.nix
|
||||
./services/hardware/amdvlk.nix
|
||||
./services/hardware/argonone.nix
|
||||
./services/hardware/asusd.nix
|
||||
|
43
nixos/modules/services/hardware/amdgpu.nix
Normal file
43
nixos/modules/services/hardware/amdgpu.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.hardware.amdgpu;
|
||||
in {
|
||||
options.hardware.amdgpu = {
|
||||
legacySupport.enable = lib.mkEnableOption ''
|
||||
using `amdgpu` kernel driver instead of `radeon` for Southern Islands
|
||||
(Radeon HD 7000) series and Sea Islands (Radeon HD 8000)
|
||||
series cards. Note: this removes support for analog video outputs,
|
||||
which is only available in the `radeon` driver
|
||||
'';
|
||||
initrd.enable = lib.mkEnableOption ''
|
||||
loading `amdgpu` kernelModule in stage 1.
|
||||
Can fix lower resolution in boot screen during initramfs phase
|
||||
'';
|
||||
opencl.enable = lib.mkEnableOption ''OpenCL support using ROCM runtime library'';
|
||||
# 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.opencl.enable {
|
||||
enable = lib.mkDefault true;
|
||||
extraPackages = [
|
||||
pkgs.rocmPackages.clr
|
||||
pkgs.rocmPackages.clr.icd
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ johnrtitor ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user