Compare commits
3 Commits
audit/v1.0
...
audit/v1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06017eddfd | ||
|
|
0ac7b6a963 | ||
|
|
3d2ae4cdcb |
@@ -3,7 +3,6 @@ package tui
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os/exec"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"bee/audit/internal/platform"
|
"bee/audit/internal/platform"
|
||||||
@@ -102,7 +101,7 @@ func (m model) updateNvidiaSATSetup(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// startNvidiaSAT launches the SAT and nvtop.
|
// startNvidiaSAT launches the NVIDIA acceptance pack.
|
||||||
func (m model) startNvidiaSAT() (tea.Model, tea.Cmd) {
|
func (m model) startNvidiaSAT() (tea.Model, tea.Cmd) {
|
||||||
var selectedGPUs []platform.NvidiaGPU
|
var selectedGPUs []platform.NvidiaGPU
|
||||||
for i, sel := range m.nvidiaGPUSel {
|
for i, sel := range m.nvidiaGPUSel {
|
||||||
@@ -142,31 +141,12 @@ func (m model) startNvidiaSAT() (tea.Model, tea.Cmd) {
|
|||||||
return nvidiaSATDoneMsg{title: result.Title, body: result.Body, err: err}
|
return nvidiaSATDoneMsg{title: result.Title, body: result.Body, err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
nvtopPath, lookErr := exec.LookPath("nvtop")
|
|
||||||
if lookErr != nil {
|
|
||||||
// nvtop not available: just run the SAT, show running screen
|
|
||||||
return m, satCmd
|
return m, satCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
return m, tea.Batch(
|
|
||||||
satCmd,
|
|
||||||
tea.ExecProcess(exec.Command(nvtopPath), func(_ error) tea.Msg {
|
|
||||||
return nvtopClosedMsg{}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// updateNvidiaSATRunning handles keys on the running screen.
|
// updateNvidiaSATRunning handles keys on the running screen.
|
||||||
func (m model) updateNvidiaSATRunning(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
func (m model) updateNvidiaSATRunning(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
||||||
switch msg.String() {
|
switch msg.String() {
|
||||||
case "o", "O":
|
|
||||||
nvtopPath, err := exec.LookPath("nvtop")
|
|
||||||
if err != nil {
|
|
||||||
return m, nil
|
|
||||||
}
|
|
||||||
return m, tea.ExecProcess(exec.Command(nvtopPath), func(_ error) tea.Msg {
|
|
||||||
return nvtopClosedMsg{}
|
|
||||||
})
|
|
||||||
case "a", "A":
|
case "a", "A":
|
||||||
if m.nvidiaSATCancel != nil {
|
if m.nvidiaSATCancel != nil {
|
||||||
m.nvidiaSATCancel()
|
m.nvidiaSATCancel()
|
||||||
@@ -234,5 +214,5 @@ func renderNvidiaSATSetup(m model) string {
|
|||||||
|
|
||||||
// renderNvidiaSATRunning renders the running screen.
|
// renderNvidiaSATRunning renders the running screen.
|
||||||
func renderNvidiaSATRunning() string {
|
func renderNvidiaSATRunning() string {
|
||||||
return "NVIDIA SAT\n\nTest is running...\n\n[o] Open nvtop [a] Abort test [ctrl+c] quit\n"
|
return "NVIDIA SAT\n\nTest is running...\n\n[a] Abort test [ctrl+c] quit\n"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ lb config noauto \
|
|||||||
--memtest none \
|
--memtest none \
|
||||||
--iso-volume "EASY-BEE" \
|
--iso-volume "EASY-BEE" \
|
||||||
--iso-application "EASY-BEE" \
|
--iso-application "EASY-BEE" \
|
||||||
--bootappend-live "boot=live components console=ttyS0,115200n8 console=ttyS1,115200n8 loglevel=7 systemd.log_target=console systemd.journald.forward_to_console=1 systemd.journald.max_level_console=debug username=bee user-fullname=Bee modprobe.blacklist=nouveau" \
|
--bootappend-live "boot=live components console=tty0 console=ttyS0,115200n8 loglevel=3 username=bee user-fullname=Bee modprobe.blacklist=nouveau" \
|
||||||
--apt-recommends false \
|
--apt-recommends false \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|||||||
@@ -2,12 +2,21 @@
|
|||||||
# 9001-amd-rocm.hook.chroot — install AMD ROCm SMI tool for Instinct GPU monitoring.
|
# 9001-amd-rocm.hook.chroot — install AMD ROCm SMI tool for Instinct GPU monitoring.
|
||||||
# Runs inside the live-build chroot. Adds AMD's apt repository and installs
|
# Runs inside the live-build chroot. Adds AMD's apt repository and installs
|
||||||
# rocm-smi-lib which provides the `rocm-smi` CLI (analogous to nvidia-smi).
|
# rocm-smi-lib which provides the `rocm-smi` CLI (analogous to nvidia-smi).
|
||||||
|
#
|
||||||
|
# AMD does NOT publish Debian Bookworm packages. The repo uses Ubuntu codenames
|
||||||
|
# (jammy/noble). We use jammy (Ubuntu 22.04) — its packages install cleanly on
|
||||||
|
# Debian 12 (Bookworm) due to compatible glibc/libstdc++.
|
||||||
|
# Tried versions newest-first; falls back if a point release is missing.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# ROCm versions to try in order (newest first). Fall back if a version's
|
# Ubuntu codename to use for the AMD repo (Debian has no AMD packages).
|
||||||
# Release file is missing from the repo (happens with brand-new releases).
|
ROCM_UBUNTU_DIST="jammy"
|
||||||
ROCM_CANDIDATES="6.4 6.3 6.2"
|
|
||||||
|
# ROCm point-releases to try newest-first. AMD drops old point releases
|
||||||
|
# from the repo, so we walk backwards until one responds 200.
|
||||||
|
ROCM_CANDIDATES="6.3.4 6.3.3 6.3.2 6.3.1 6.3 6.2.4 6.2.3 6.2.2 6.2.1 6.2"
|
||||||
|
|
||||||
ROCM_KEYRING="/etc/apt/keyrings/rocm.gpg"
|
ROCM_KEYRING="/etc/apt/keyrings/rocm.gpg"
|
||||||
ROCM_LIST="/etc/apt/sources.list.d/rocm.list"
|
ROCM_LIST="/etc/apt/sources.list.d/rocm.list"
|
||||||
APT_UPDATED=0
|
APT_UPDATED=0
|
||||||
@@ -51,30 +60,31 @@ if ! wget -qO- "https://repo.radeon.com/rocm/rocm.gpg.key" \
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try each ROCm version until apt-get update succeeds (repo has a Release file).
|
# Try each ROCm version until apt-get update succeeds.
|
||||||
|
# AMD repo uses Ubuntu codenames; bookworm is not published — use jammy.
|
||||||
ROCM_VERSION=""
|
ROCM_VERSION=""
|
||||||
for candidate in ${ROCM_CANDIDATES}; do
|
for candidate in ${ROCM_CANDIDATES}; do
|
||||||
cat > "${ROCM_LIST}" <<EOF
|
cat > "${ROCM_LIST}" <<EOF
|
||||||
deb [arch=amd64 signed-by=${ROCM_KEYRING}] https://repo.radeon.com/rocm/apt/${candidate} bookworm main
|
deb [arch=amd64 signed-by=${ROCM_KEYRING}] https://repo.radeon.com/rocm/apt/${candidate} ${ROCM_UBUNTU_DIST} main
|
||||||
EOF
|
EOF
|
||||||
if apt-get update -qq 2>/dev/null; then
|
if apt-get update -qq 2>/dev/null; then
|
||||||
ROCM_VERSION="${candidate}"
|
ROCM_VERSION="${candidate}"
|
||||||
echo "=== AMD ROCm ${ROCM_VERSION}: repository available ==="
|
echo "=== AMD ROCm ${ROCM_VERSION} (${ROCM_UBUNTU_DIST}): repository available ==="
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "WARN: ROCm ${candidate} repository not available for bookworm, trying next..."
|
echo "WARN: ROCm ${candidate} not available, trying next..."
|
||||||
rm -f "${ROCM_LIST}"
|
rm -f "${ROCM_LIST}"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "${ROCM_VERSION}" ]; then
|
if [ -z "${ROCM_VERSION}" ]; then
|
||||||
echo "WARN: no ROCm apt repository available for bookworm — skipping ROCm install"
|
echo "WARN: no ROCm apt repository available — skipping ROCm install"
|
||||||
rm -f "${ROCM_KEYRING}"
|
rm -f "${ROCM_KEYRING}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# rocm-smi-lib provides the rocm-smi CLI tool for GPU monitoring
|
# rocm-smi-lib provides the rocm-smi CLI tool for GPU monitoring
|
||||||
if apt-get install -y --no-install-recommends rocm-smi-lib 2>/dev/null; then
|
if DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends rocm-smi-lib; then
|
||||||
echo "=== AMD ROCm: rocm-smi installed ==="
|
echo "=== AMD ROCm: rocm-smi-lib installed ==="
|
||||||
if [ -x /opt/rocm/bin/rocm-smi ]; then
|
if [ -x /opt/rocm/bin/rocm-smi ]; then
|
||||||
ln -sf /opt/rocm/bin/rocm-smi /usr/local/bin/rocm-smi
|
ln -sf /opt/rocm/bin/rocm-smi /usr/local/bin/rocm-smi
|
||||||
else
|
else
|
||||||
@@ -85,7 +95,7 @@ if apt-get install -y --no-install-recommends rocm-smi-lib 2>/dev/null; then
|
|||||||
fi
|
fi
|
||||||
rocm-smi --version 2>/dev/null || true
|
rocm-smi --version 2>/dev/null || true
|
||||||
else
|
else
|
||||||
echo "WARN: rocm-smi-lib install failed — GPU monitoring unavailable"
|
echo "WARN: rocm-smi-lib install failed — AMD GPU monitoring unavailable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean up apt lists to keep ISO size down
|
# Clean up apt lists to keep ISO size down
|
||||||
|
|||||||
Reference in New Issue
Block a user