Skip to content

Commit 6e886a9

Browse files
committed
Add diamondnode-ops: operational and functional commands for GTX 1650 environment (status, cleanup, reliable benchmarking with llama-bench, GPU watch)
1 parent 1f202cb commit 6e886a9

5 files changed

Lines changed: 155 additions & 0 deletions

File tree

diamondnode-ops/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# diamondnode-ops
2+
3+
Operational and functional commands for the diamondnode (GTX 1650) environment in the Genesis Conductor / Hermes-Openclaw project.
4+
5+
## Scripts
6+
7+
- `status.sh` — Comprehensive status (GPU, model, native binary, disk, podman, processes).
8+
- `cleanup.sh` — Safe kill of runaway llama processes + deletion of large benchmark logs.
9+
- `run_bench.sh` — Reliable statistical benchmarks using the proper `llama-bench` tool (JSON output, avoids log flooding).
10+
- `gpu_watch.sh` — Live GPU + disk monitor.
11+
12+
## Usage on diamondnode
13+
14+
```bash
15+
# Copy this directory to diamondnode (e.g. via rsync or git)
16+
rsync -avz diamondnode-ops/ diamondnode@192.168.1.228:~/diamondnode-ops/
17+
18+
ssh diamondnode@192.168.1.228
19+
cd ~/diamondnode-ops
20+
./status.sh
21+
./cleanup.sh
22+
./run_bench.sh
23+
./gpu_watch.sh
24+
```
25+
26+
These commands are designed for the real hardware environment (Ubuntu + GTX 1650 + native llama.cpp CUDA build).
27+
28+
## Notes
29+
- Always run cleanup before new benchmark attempts.
30+
- Use `run_bench.sh` for clean statistical data (preferred over raw llama-cli loops).
31+
- All scripts are idempotent and safe where possible.
32+
33+
Part of the ag-15 / Hermes-Openclaw operational tooling.

diamondnode-ops/cleanup.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# diamondnode-ops/cleanup.sh
3+
# Safe cleanup of runaway processes and large logs on diamondnode
4+
5+
set -euo pipefail
6+
7+
echo "=== DIAMONDNODE CLEANUP $(date -Iseconds) ==="
8+
9+
echo "Killing llama* and benchmark processes..."
10+
pkill -9 -f "llama-bench\|llama-cli\|run_native" 2>/dev/null || true
11+
sleep 2
12+
13+
echo "Current GPU:"
14+
nvidia-smi --query-gpu=utilization.gpu,memory.used --format=csv,noheader
15+
16+
echo ""
17+
echo "Deleting large benchmark logs (>50MB)..."
18+
find /tmp -name "*diamondnode*bench*.log" -o -name "*native_bench*.log" | while read f; do
19+
if [ -f "$f" ]; then
20+
size=$(du -m "$f" | cut -f1)
21+
if [ "$size" -gt 50 ]; then
22+
echo "Deleting $f ($size MB)"
23+
rm -f "$f"
24+
fi
25+
fi
26+
done
27+
28+
echo ""
29+
echo "Disk after:"
30+
df -h /tmp
31+
32+
echo "=== CLEANUP COMPLETE ==="

diamondnode-ops/gpu_watch.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# diamondnode-ops/gpu_watch.sh
3+
# Simple GPU monitor for diamondnode
4+
5+
watch -n 2 'nvidia-smi --query-gpu=name,memory.used,memory.total,utilization.gpu --format=csv,noheader && echo "" && df -h /tmp'

diamondnode-ops/run_bench.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# diamondnode-ops/run_bench.sh
3+
# Reliable native benchmark using llama-bench (preferred for stats)
4+
5+
set -euo pipefail
6+
7+
MODEL="/home/diamondnode/models/Hermes-3-Llama-3.1-8B.Q4_K_M.gguf"
8+
BENCH="/home/diamondnode/llama.cpp/build/bin/llama-bench"
9+
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
10+
OUTDIR="/tmp/bench_results"
11+
mkdir -p "$OUTDIR"
12+
LOG="$OUTDIR/bench_${TIMESTAMP}.jsonl"
13+
14+
if [ ! -x "$BENCH" ]; then
15+
echo "llama-bench not found or not executable"
16+
exit 1
17+
fi
18+
19+
echo "=== RELIABLE NATIVE BENCHMARK $(date -Iseconds) ===" | tee -a "$LOG"
20+
echo "Model: $MODEL" | tee -a "$LOG"
21+
echo "Binary: $BENCH" | tee -a "$LOG"
22+
23+
# Clean statistical runs with JSON output (avoids log flood)
24+
for LAYERS in 4 8 12; do # Start conservative for 4GB VRAM
25+
echo "Running layers=$LAYERS ..."
26+
$BENCH \
27+
-m "$MODEL" \
28+
-ngl $LAYERS \
29+
-p 512 \
30+
-n 64 \
31+
-r 5 \
32+
-b 256 \
33+
-ub 128 \
34+
-t 4 \
35+
--progress \
36+
-o json \
37+
--no-warmup 2>&1 | tee -a "$LOG"
38+
done
39+
40+
echo "Results saved to $LOG"
41+
echo "=== BENCH COMPLETE ==="

diamondnode-ops/status.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# diamondnode-ops/status.sh
3+
# Operational status check for diamondnode (GTX 1650 setup)
4+
5+
set -euo pipefail
6+
7+
echo "=== DIAMONDNODE OPERATIONAL STATUS ==="
8+
echo "Timestamp: $(date -Iseconds)"
9+
echo "Host: $(hostname)"
10+
echo ""
11+
12+
echo "=== GPU ==="
13+
nvidia-smi --query-gpu=name,memory.total,memory.free,utilization.gpu,driver_version --format=csv,noheader || echo "nvidia-smi failed"
14+
echo ""
15+
16+
echo "=== MODEL ==="
17+
ls -lh /home/diamondnode/models/ 2>/dev/null || echo "No models directory"
18+
echo ""
19+
20+
echo "=== NATIVE LLAMA.CPP BINARY ==="
21+
if [ -f /home/diamondnode/llama.cpp/build/bin/llama-cli ]; then
22+
ls -l /home/diamondnode/llama.cpp/build/bin/llama-cli
23+
sha256sum /home/diamondnode/llama.cpp/build/bin/llama-cli
24+
else
25+
echo "llama-cli not found"
26+
fi
27+
if [ -f /home/diamondnode/llama.cpp/build/bin/llama-bench ]; then
28+
echo "llama-bench present"
29+
fi
30+
echo ""
31+
32+
echo "=== DISK ==="
33+
df -h /home/diamondnode /tmp 2>/dev/null | cat
34+
echo ""
35+
36+
echo "=== PODMAN ==="
37+
podman --version 2>/dev/null || echo "podman not available"
38+
echo ""
39+
40+
echo "=== KEY PROCESSES ==="
41+
ps aux | grep -E "llama|benchmark|python|node" | grep -v grep | head -10 | cat || echo "No relevant processes"
42+
echo ""
43+
44+
echo "=== END STATUS ==="

0 commit comments

Comments
 (0)