From 53ef1f28c68d191e934e95c7d9622300cf490315 Mon Sep 17 00:00:00 2001 From: stitchy Date: Sun, 3 Nov 2024 11:11:06 -0800 Subject: [PATCH] VFIO fixes and malachite things --- config/eww/eww.yuck | 1 - hosts/malachite/default.nix | 15 +++++++++++++++ hosts/malachite/hardware-configuration.nix | 18 +++++++++--------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/config/eww/eww.yuck b/config/eww/eww.yuck index f4f5305..59dfbc4 100644 --- a/config/eww/eww.yuck +++ b/config/eww/eww.yuck @@ -92,7 +92,6 @@ :monitor 0 :geometry (geometry :x "4px" :y "1%" - :width "2.5%" :height "98%" :anchor "left center") :stacking "fg" diff --git a/hosts/malachite/default.nix b/hosts/malachite/default.nix index d264bf7..8e7052e 100644 --- a/hosts/malachite/default.nix +++ b/hosts/malachite/default.nix @@ -40,6 +40,14 @@ let # Load VFIO Kernel Module modprobe vfio vfio_pci vfio_iommu_type1 + # Performance Governer + for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "performance" > "$file"; done + + # Isolating CPU + systemctl set-property --runtime -- user.slice AllowedCPUs=16-19 + systemctl set-property --runtime -- system.slice AllowedCPUs=16-19 + systemctl set-property --runtime -- init.scope AllowedCPUs=16-19 + elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then modprobe -r vfio_iommu_type1 vfio_pci vfio @@ -61,6 +69,13 @@ let # Reload Modules modprobe amdgpu + # Back to On-Demand Scheduler + for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "ondemand" > "$file"; done + + systemctl set-property --runtime -- user.slice AllowedCPUs=0-19 + systemctl set-property --runtime -- system.slice AllowedCPUs=0-19 + systemctl set-property --runtime -- init.scope AllowedCPUs=0-19 + fi fi diff --git a/hosts/malachite/hardware-configuration.nix b/hosts/malachite/hardware-configuration.nix index 8f0d845..c95853a 100644 --- a/hosts/malachite/hardware-configuration.nix +++ b/hosts/malachite/hardware-configuration.nix @@ -20,22 +20,22 @@ "/" = { device = "/dev/disk/by-uuid/8e30bb30-eacf-4d7d-bcec-c2b39982de13"; fsType = "btrfs"; - options = [ "subvol=nix" ]; + options = [ "subvol=nix" "compress=zstd" ]; }; "/home" = { device = "/dev/disk/by-uuid/8e30bb30-eacf-4d7d-bcec-c2b39982de13"; fsType = "btrfs"; - options = [ "subvol=homes/stitchymain" ]; + options = [ "subvol=homes/stitchymain" "compress=zstd" ]; }; "/nix/store" = { device = "/dev/disk/by-uuid/8e30bb30-eacf-4d7d-bcec-c2b39982de13"; fsType = "btrfs"; - options = [ "subvol=store" ]; + options = [ "subvol=store" "noatime" "compress=zstd" ]; }; "/persist" = { device = "/dev/disk/by-uuid/8e30bb30-eacf-4d7d-bcec-c2b39982de13"; fsType = "btrfs"; - options = [ "subvol=@persist" ]; + options = [ "subvol=@persist" "compress=zstd" ]; }; "/boot" = { device = "/dev/disk/by-uuid/CB12-5062"; @@ -44,27 +44,27 @@ "/home/stitchynyan/Music" = { device = "/dev/disk/by-uuid/feb8239f-5d09-4184-8e46-52185beaa040"; fsType = "btrfs"; - options = [ "subvol=music/stitchtunes" "x-systemd.automount" ]; + options = [ "subvol=music/stitchtunes" "compress=zstd" "x-systemd.automount" ]; }; "/home/stitchynyan/Pictures" = { device = "/dev/disk/by-uuid/feb8239f-5d09-4184-8e46-52185beaa040"; fsType = "btrfs"; - options = [ "subvol=pictures/stitchpics" "x-systemd.automount" ]; + options = [ "subvol=pictures/stitchpics" "compress=zstd" "x-systemd.automount" ]; }; "/home/stitchynyan/Programs/Steam" = { device = "/dev/disk/by-uuid/feb8239f-5d09-4184-8e46-52185beaa040"; fsType = "btrfs"; - options = [ "subvol=games/stitchgames" "x-systemd.automount" ]; + options = [ "subvol=games/stitchgames" "compress=zstd" "x-systemd.automount" ]; }; "/home/stitchynyan/Videos" = { device = "/dev/disk/by-uuid/feb8239f-5d09-4184-8e46-52185beaa040"; fsType = "btrfs"; - options = [ "subvol=videos/stitchshows" "x-systemd.automount" ]; + options = [ "subvol=videos/stitchshows" "compress=zstd" "x-systemd.automount" ]; }; "/home/stitchynyan/VirtualMachines" = { device = "/dev/disk/by-uuid/feb8239f-5d09-4184-8e46-52185beaa040"; fsType = "btrfs"; - options = [ "subvol=virtualmachines/stitchvms" "x-systemd.automount" ]; + options = [ "subvol=virtualmachines/stitchvms" "compress=zstd" "x-systemd.automount" ]; }; };