nixos/amdgpu: add overdrive and ppfeaturemask option (#411155)


- `programs.corectrl.gpuOverclock.enable` -> `hardware.amdgpu.overdrive.enable`
- `programs.corectrl.gpuOverclock.ppfeaturemask` -> `hardware.amdgpu.overdrive.ppfeaturemask`
- `programs.tuxclocker.enableAMD` -> `hardware.amdgpu.overdrive.enable`

Changed files
+50 -39
nixos
doc
manual
release-notes
modules
hardware
services
hardware
misc
+3
nixos/doc/manual/release-notes/rl-2511.section.md
···
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
- `services.clamsmtp` is unmaintained and was removed from Nixpkgs.
···
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
- `services.clamsmtp` is unmaintained and was removed from Nixpkgs.
+
+
- `amdgpu` kernel driver overdrive mode can now be enabled by setting [hardware.amdgpu.overdrive.enable](#opt-hardware.amdgpu.overdrive.enable) and customized through [hardware.amdgpu.overdrive.ppfeaturemask](#opt-hardware.amdgpu.overdrive.ppfeaturemask).
+
This allows for fine-grained control over the GPU's performance and maybe required by overclocking softwares like Corectrl and Lact. These new options replace old options such as {option}`programs.corectrl.gpuOverclock.enable` and {option}`programs.tuxclocker.enableAMD`.
+11 -24
nixos/modules/hardware/corectrl.nix
···
inherit (lib)
mkEnableOption
mkIf
-
mkOption
mkPackageOption
;
cfg = config.programs.corectrl;
in
{
options.programs.corectrl = {
enable = mkEnableOption ''
CoreCtrl, a tool to overclock amd graphics cards and processors.
···
package = mkPackageOption pkgs "corectrl" {
extraDescription = "Useful for overriding the configuration options used for the package.";
};
-
-
gpuOverclock = {
-
enable = mkEnableOption ''
-
GPU overclocking
-
'';
-
ppfeaturemask = mkOption {
-
type = lib.types.str;
-
default = "0xfffd7fff";
-
example = "0xffffffff";
-
description = ''
-
Sets the `amdgpu.ppfeaturemask` kernel option.
-
In particular, it is used here to set the overdrive bit.
-
Default is `0xfffd7fff` as it is less likely to cause flicker issues.
-
Setting it to `0xffffffff` enables all features.
-
'';
-
};
-
};
};
config = mkIf cfg.enable {
···
}
});
'';
-
-
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/amd_shared.h#n169
-
# The overdrive bit
-
boot.kernelParams = mkIf cfg.gpuOverclock.enable [
-
"amdgpu.ppfeaturemask=${cfg.gpuOverclock.ppfeaturemask}"
-
];
};
meta.maintainers = with lib.maintainers; [
···
inherit (lib)
mkEnableOption
mkIf
mkPackageOption
;
cfg = config.programs.corectrl;
in
{
+
imports = [
+
(lib.mkRenamedOptionModule
+
[ "programs" "corectrl" "gpuOverclock" "enable" ]
+
[ "hardware" "amdgpu" "overdrive" "enable" ]
+
)
+
(lib.mkRenamedOptionModule
+
[ "programs" "corectrl" "gpuOverclock" "ppfeaturemask" ]
+
[ "hardware" "amdgpu" "overdrive" "ppfeaturemask" ]
+
)
+
];
+
options.programs.corectrl = {
enable = mkEnableOption ''
CoreCtrl, a tool to overclock amd graphics cards and processors.
···
package = mkPackageOption pkgs "corectrl" {
extraDescription = "Useful for overriding the configuration options used for the package.";
};
};
config = mkIf cfg.enable {
···
}
});
'';
};
meta.maintainers = with lib.maintainers; [
+29 -6
nixos/modules/services/hardware/amdgpu.nix
···
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" ];
···
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
'';
+
+
overdrive = {
+
enable = lib.mkEnableOption ''`amdgpu` overdrive mode for overclocking'';
+
+
ppfeaturemask = lib.mkOption {
+
type = lib.types.str;
+
default = "0xfffd7fff";
+
example = "0xffffffff";
+
description = ''
+
Sets the `amdgpu.ppfeaturemask` kernel option. It can be used to enable the overdrive bit.
+
Default is `0xfffd7fff` as it is less likely to cause flicker issues. Setting it to
+
`0xffffffff` enables all features, but also can be unstable. See
+
[the kernel documentation](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/amd_shared.h#n169)
+
for more information.
+
'';
+
};
+
};
+
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"
+
]
+
++ lib.optionals cfg.overdrive.enable [
+
"amdgpu.ppfeaturemask=${cfg.overdrive.ppfeaturemask}"
+
];
boot.initrd.kernelModules = lib.optionals cfg.initrd.enable [ "amdgpu" ];
+7 -9
nixos/modules/services/misc/tuxclocker.nix
···
cfg = config.programs.tuxclocker;
in
{
options.programs.tuxclocker = {
enable = lib.mkEnableOption ''
TuxClocker, a hardware control and monitoring program
-
'';
-
-
enableAMD = lib.mkEnableOption ''
-
AMD GPU controls.
-
Sets the `amdgpu.ppfeaturemask` kernel parameter to 0xfffd7fff to enable all TuxClocker controls
'';
enabledNVIDIADevices = lib.mkOption {
···
);
in
lib.concatStrings (map configSection cfg.enabledNVIDIADevices);
-
-
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/amd_shared.h#n207
-
# Enable everything modifiable in TuxClocker
-
boot.kernelParams = lib.mkIf cfg.enableAMD [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
};
}
···
cfg = config.programs.tuxclocker;
in
{
+
imports = [
+
(lib.mkRenamedOptionModule
+
[ "programs" "tuxclocker" "enableAMD" ]
+
[ "hardware" "amdgpu" "overdrive" "enable" ]
+
)
+
];
+
options.programs.tuxclocker = {
enable = lib.mkEnableOption ''
TuxClocker, a hardware control and monitoring program
'';
enabledNVIDIADevices = lib.mkOption {
···
);
in
lib.concatStrings (map configSection cfg.enabledNVIDIADevices);
};
}