[Hardware] Fix crashes on AMD Zen 1 CPUs

Caused my Opcache issue.
Only real fix is to RMA the processor, but that is no longer an option
for me.
This commit is contained in:
Antoine Viallon 2023-02-27 19:45:15 +01:00
parent a8f78f35db
commit 7e9048b5a1
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -3,6 +3,7 @@ with lib;
let
cfg = config.aviallon.hardware;
desktopCfg = config.aviallon.desktop;
generalCfg = config.aviallon.general;
in
{
options.aviallon.hardware = { };
@ -19,6 +20,13 @@ in
++ optional cfg.nvidia.enable pkgs.nvtop-nvidia
;
boot.kernel.sysctl = {
# Why: https://www.phoronix.com/news/Ryzen-Segv-Response
# Workaround: https://forums.gentoo.org/viewtopic-p-2605135.html#2605135
"kernel.randomize_va_space" = mkIf (generalCfg.cpuVendor == "amd" && generalCfg.cpuArch == "znver1" ) (warn "Disable Adress Space Layout Randomization on Ryzen 1 CPU" 0);
};
};
}