diff --git a/iso/builder/config/bootloaders/grub-pc/grub.cfg b/iso/builder/config/bootloaders/grub-pc/grub.cfg index ae7be22..1db9d30 100644 --- a/iso/builder/config/bootloaders/grub-pc/grub.cfg +++ b/iso/builder/config/bootloaders/grub-pc/grub.cfg @@ -11,18 +11,18 @@ echo " Hardware Audit LiveCD" echo "" menuentry "EASY-BEE" { - linux @KERNEL_LIVE@ @APPEND_LIVE@ nomodeset bee.nvidia.mode=normal net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable nowatchdog nosoftlockup + linux @KERNEL_LIVE@ @APPEND_LIVE@ nomodeset bee.nvidia.mode=normal net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 nowatchdog nosoftlockup initrd @INITRD_LIVE@ } submenu "EASY-BEE (advanced options) -->" { menuentry "EASY-BEE — GSP=off" { - linux @KERNEL_LIVE@ @APPEND_LIVE@ nomodeset bee.nvidia.mode=gsp-off net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable nowatchdog nosoftlockup + linux @KERNEL_LIVE@ @APPEND_LIVE@ nomodeset bee.nvidia.mode=gsp-off net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 nowatchdog nosoftlockup initrd @INITRD_LIVE@ } menuentry "EASY-BEE — KMS (no nomodeset)" { - linux @KERNEL_LIVE@ @APPEND_LIVE@ bee.nvidia.mode=normal net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable nowatchdog nosoftlockup + linux @KERNEL_LIVE@ @APPEND_LIVE@ bee.nvidia.mode=normal net.ifnames=0 biosdevname=0 mitigations=off transparent_hugepage=always numa_balancing=disable pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 nowatchdog nosoftlockup initrd @INITRD_LIVE@ } diff --git a/iso/builder/config/bootloaders/isolinux/live.cfg.in b/iso/builder/config/bootloaders/isolinux/live.cfg.in index 3f0c11a..0c75ca4 100644 --- a/iso/builder/config/bootloaders/isolinux/live.cfg.in +++ b/iso/builder/config/bootloaders/isolinux/live.cfg.in @@ -3,31 +3,31 @@ label live-@FLAVOUR@-normal menu default linux @LINUX@ initrd @INITRD@ - append @APPEND_LIVE@ bee.nvidia.mode=normal + append @APPEND_LIVE@ bee.nvidia.mode=normal pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 label live-@FLAVOUR@-kms menu label EASY-BEE (^graphics/KMS) linux @LINUX@ initrd @INITRD@ - append @APPEND_LIVE@ bee.display=kms bee.nvidia.mode=normal + append @APPEND_LIVE@ bee.display=kms bee.nvidia.mode=normal pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 label live-@FLAVOUR@-toram menu label EASY-BEE (^load to RAM) linux @LINUX@ initrd @INITRD@ - append @APPEND_LIVE@ toram bee.nvidia.mode=normal + append @APPEND_LIVE@ toram bee.nvidia.mode=normal pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 label live-@FLAVOUR@-gsp-off menu label EASY-BEE (^NVIDIA GSP=off) linux @LINUX@ initrd @INITRD@ - append @APPEND_LIVE@ nomodeset bee.nvidia.mode=gsp-off + append @APPEND_LIVE@ nomodeset bee.nvidia.mode=gsp-off pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 label live-@FLAVOUR@-kms-gsp-off menu label EASY-BEE (g^raphics/KMS, GSP=off) linux @LINUX@ initrd @INITRD@ - append @APPEND_LIVE@ bee.display=kms bee.nvidia.mode=gsp-off + append @APPEND_LIVE@ bee.display=kms bee.nvidia.mode=gsp-off pcie_aspm=off intel_idle.max_cstate=1 processor.max_cstate=1 label live-@FLAVOUR@-failsafe menu label EASY-BEE (^fail-safe) diff --git a/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot b/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot index c1b38ed..8fee9b8 100755 --- a/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot +++ b/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot @@ -25,6 +25,7 @@ ensure_bee_console_user() { ensure_bee_console_user # Enable common bee services +systemctl enable bee-hpc-tuning.service systemctl enable bee-network.service systemctl enable bee-preflight.service systemctl enable bee-audit.service @@ -55,6 +56,7 @@ fi # nogpu: no GPU services needed # Ensure scripts are executable +chmod +x /usr/local/bin/bee-hpc-tuning 2>/dev/null || true chmod +x /usr/local/bin/bee-network.sh 2>/dev/null || true chmod +x /usr/local/bin/bee-sshsetup 2>/dev/null || true chmod +x /usr/local/bin/bee-smoketest 2>/dev/null || true diff --git a/iso/overlay/etc/systemd/system/bee-hpc-tuning.service b/iso/overlay/etc/systemd/system/bee-hpc-tuning.service new file mode 100644 index 0000000..53967fa --- /dev/null +++ b/iso/overlay/etc/systemd/system/bee-hpc-tuning.service @@ -0,0 +1,14 @@ +[Unit] +Description=Bee: HPC tuning (CPU governor, C-states) +After=local-fs.target +Before=bee-nvidia.service bee-audit.service + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/bee-log-run /appdata/bee/export/bee-hpc-tuning.log /usr/local/bin/bee-hpc-tuning +StandardOutput=journal +StandardError=journal +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/iso/overlay/usr/local/bin/bee-hpc-tuning b/iso/overlay/usr/local/bin/bee-hpc-tuning new file mode 100644 index 0000000..be1153e --- /dev/null +++ b/iso/overlay/usr/local/bin/bee-hpc-tuning @@ -0,0 +1,41 @@ +#!/bin/sh +# bee-hpc-tuning — apply HPC tuning for deterministic benchmarking +# Called by bee-hpc-tuning.service at boot. + +log() { echo "[bee-hpc-tuning] $*"; } + +# ── CPU governor ──────────────────────────────────────────────────────────── +# Set all CPU cores to performance governor via sysfs. +# cpupower is not available; write directly to scaling_governor. +governor_ok=0 +governor_fail=0 +for gov_path in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do + [ -f "$gov_path" ] || continue + if echo performance > "$gov_path" 2>/dev/null; then + governor_ok=$((governor_ok + 1)) + else + governor_fail=$((governor_fail + 1)) + fi +done + +if [ "$governor_ok" -gt 0 ] && [ "$governor_fail" -eq 0 ]; then + log "CPU governor set to performance on ${governor_ok} core(s)" +elif [ "$governor_ok" -gt 0 ]; then + log "WARN: CPU governor: ${governor_ok} OK, ${governor_fail} failed" +elif [ "$governor_fail" -gt 0 ]; then + log "WARN: failed to set CPU governor on ${governor_fail} core(s)" +else + log "WARN: no cpufreq scaling_governor paths found (C-state governor or HW-controlled)" +fi + +# ── Transparent Huge Pages ─────────────────────────────────────────────────── +# Kernel cmdline sets transparent_hugepage=always at boot, but confirm and log. +thp_path=/sys/kernel/mm/transparent_hugepage/enabled +if [ -f "$thp_path" ]; then + current=$(cat "$thp_path" 2>/dev/null) + log "transparent_hugepage: ${current}" +else + log "WARN: transparent_hugepage sysfs path not found" +fi + +log "done"