diff --git a/hosts/monolith/amdgpu.nix b/hosts/monolith/amdgpu.nix deleted file mode 100644 index c02af7e..0000000 --- a/hosts/monolith/amdgpu.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, ... }: -let - undervoltGpu = pkgs.writeShellScript "undervolt-gpu" '' - set -xe - cd $1 - echo "manual" > power_dpm_force_performance_level - echo "1" > pp_power_profile_mode - test -e pp_od_clk_voltage - echo "vo -120" > pp_od_clk_voltage - echo "c" > pp_od_clk_voltage - ''; -in -{ - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelParams = [ - "amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug - "video=DP-1:1920x1080@144" - "amdgpu.ppfeaturemask=0xfffd7fff" # enable undervolting - ]; - - hardware.opengl.driSupport = true; - # # For 32 bit applications - hardware.opengl.driSupport32Bit = true; - - hardware.opengl.extraPackages = with pkgs; [ - libva - libvdpau - vaapiVdpau - rocm-opencl-icd - rocm-opencl-runtime - rocmPackages.rocm-smi - ]; - - services.udev.extraRules = '' - ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device" - ''; -} diff --git a/hosts/monolith/default.nix b/hosts/monolith/default.nix index 962addc..ff2b193 100644 --- a/hosts/monolith/default.nix +++ b/hosts/monolith/default.nix @@ -23,7 +23,7 @@ in imports = [ (modulesPath + "/installer/scan/not-detected.nix") ./partition.nix - ./amdgpu.nix + ./undervolt.nix ]; boot.initrd.availableKernelModules = [ "nvme" @@ -52,12 +52,28 @@ in "amdgpu" "zenpower" ]; - + boot.kernelParams = [ + "amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug + "video=DP-1:1920x1080@144" + ]; systemd.sleep.extraConfig = '' HibernateDelaySec=30s SuspendState=mem ''; + hardware.opengl.driSupport = true; + # # For 32 bit applications + hardware.opengl.driSupport32Bit = true; + + hardware.opengl.extraPackages = with pkgs; [ + libva + libvdpau + vaapiVdpau + rocm-opencl-icd + rocm-opencl-runtime + rocmPackages.rocm-smi + ]; + fileSystems."/mnt/old" = { device = "/dev/disk/by-label/BTRFS_ROOT"; fsType = "btrfs"; diff --git a/hosts/monolith/undervolt.nix b/hosts/monolith/undervolt.nix new file mode 100644 index 0000000..9f60aee --- /dev/null +++ b/hosts/monolith/undervolt.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +let + undervoltGpu = pkgs.writeShellScript "undervolt-gpu" '' + set -xe + cd $1 + echo "manual" > power_dpm_force_performance_level + echo "1" > pp_power_profile_mode + test -e pp_od_clk_voltage + echo "vo -120" > pp_od_clk_voltage + echo "c" > pp_od_clk_voltage + ''; +in +{ + boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ]; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device" + ''; +} diff --git a/hosts/phantom/default.nix b/hosts/phantom/default.nix index 6a246e4..e5570ee 100644 --- a/hosts/phantom/default.nix +++ b/hosts/phantom/default.nix @@ -21,7 +21,6 @@ ./invidious.nix ./davi.nix ./goofs.nix - ./factorio-server.nix ]; networking.hostName = "phantom"; diff --git a/hosts/phantom/factorio-server.nix b/hosts/phantom/factorio-server.nix deleted file mode 100644 index a4b13b5..0000000 --- a/hosts/phantom/factorio-server.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, ... }: -{ - services.factorio = { - enable = true; - package = pkgs.unstable.factorio-headless.overrideAttrs (_: rec { - version = "2.0.12"; - src = pkgs.fetchurl { - name = "factorio_headless_x64-${version}.tar.xz"; - url = "https://www.factorio.com/get-download/${version}/headless/linux64"; - hash = "sha256-0vgg5eJ6ZEFO0TUixNsByCs8YyPGOArgqnXbT5RIjTE="; - }; - }); - public = true; - lan = true; - openFirewall = true; - admins = [ "lelgenio" ]; - extraSettingsFile = config.age.secrets.phantom-factorio-settings.path; - }; - - age.secrets.phantom-factorio-settings = { - file = ../../secrets/phantom-factorio-settings.age; - mode = "777"; - }; -} diff --git a/secrets/phantom-factorio-settings.age b/secrets/phantom-factorio-settings.age deleted file mode 100644 index 77eb8bd..0000000 Binary files a/secrets/phantom-factorio-settings.age and /dev/null differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 65f495a..7b5fdd8 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -12,7 +12,6 @@ in "monolith-forgejo-runner-token.age".publicKeys = [ main_ssh_public_key ]; "lelgenio-cachix.age".publicKeys = [ main_ssh_public_key ]; "monolith-nix-serve-privkey.age".publicKeys = [ main_ssh_public_key ]; - "phantom-factorio-settings.age".publicKeys = [ main_ssh_public_key ]; "phantom-nextcloud.age".publicKeys = [ main_ssh_public_key ]; "phantom-writefreely.age".publicKeys = [ main_ssh_public_key ]; "phantom-renawiki.age".publicKeys = [ main_ssh_public_key ];