Initial commit

This commit is contained in:
Felipe Cardoso
2026-03-25 20:13:15 +01:00
commit c596e38e9e
26 changed files with 2345 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env bash
# Install monitoring tools for Strix Halo
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../../lib/common.sh"
log_header "Monitoring Tools Installer"
# ── amdgpu_top (most important) ─────────────────────────
if is_cmd amdgpu_top; then
log_success "amdgpu_top already installed: $(amdgpu_top --version 2>&1 | head -1)"
else
log_info "Installing amdgpu_top (best AMD GPU monitor)..."
installed=false
# Method 1: Install RPM from GitHub releases (fastest, works on Fedora)
if ! $installed; then
log_info "Downloading pre-built RPM from GitHub releases..."
AMDGPU_TOP_VERSION="0.11.2"
RPM_URL="https://github.com/Umio-Yasuno/amdgpu_top/releases/download/v${AMDGPU_TOP_VERSION}/amdgpu_top-${AMDGPU_TOP_VERSION}-1.x86_64.rpm"
RPM_FILE="/tmp/amdgpu_top-${AMDGPU_TOP_VERSION}.rpm"
if curl -fsSL -o "$RPM_FILE" "$RPM_URL" 2>/dev/null; then
if sudo dnf install -y "$RPM_FILE" 2>&1; then
installed=true
log_success "amdgpu_top installed from RPM"
rm -f "$RPM_FILE"
else
log_warn "RPM install failed"
fi
else
log_warn "RPM download failed"
fi
fi
# Method 2: Try dnf repos
if ! $installed; then
log_info "Trying dnf repos..."
if sudo dnf install -y amdgpu_top 2>/dev/null; then
installed=true
log_success "amdgpu_top installed via dnf"
fi
fi
# Method 3: cargo (if available)
if ! $installed && is_cmd cargo; then
log_info "Building from source via cargo..."
if cargo install amdgpu_top 2>&1; then
installed=true
log_success "amdgpu_top installed via cargo"
else
log_warn "cargo install failed"
fi
fi
if ! $installed; then
log_warn "Could not install amdgpu_top automatically."
log_info "Manual options:"
log_info " 1. Download RPM: curl -LO $RPM_URL && sudo dnf install ./amdgpu_top-*.rpm"
log_info " 2. Download AppImage: https://github.com/Umio-Yasuno/amdgpu_top/releases/latest"
fi
fi
# ── btop ─────────────────────────────────────────────────
if is_cmd btop; then
log_success "btop already installed"
else
log_info "Installing btop..."
if sudo dnf install -y btop 2>&1; then
log_success "btop installed"
else
log_warn "Could not install btop via dnf"
fi
fi
# ── tmux (needed for dashboard) ──────────────────────────
if is_cmd tmux; then
log_success "tmux already installed"
else
log_info "Installing tmux..."
if sudo dnf install -y tmux 2>&1; then
log_success "tmux installed"
else
log_warn "Could not install tmux via dnf"
fi
fi
# ── Verify existing tools ───────────────────────────────
log_header "Monitoring Tools Status"
for tool in amdgpu_top nvtop btop amd-smi rocm-smi tmux; do
if is_cmd "$tool"; then
log_success "$tool"
else
log_warn "$tool — not installed"
fi
done