Add fleet groups, agent screenshots, deploy guards, and Crucible polish.
This commit is contained in:
@@ -2,8 +2,11 @@ package client
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"crypto-miner-agent/deploy"
|
||||
)
|
||||
|
||||
// ResourcePressure is a mining-specific runtime snapshot sent every heartbeat.
|
||||
@@ -55,11 +58,21 @@ func (r *ResourcePressure) Throttled() bool {
|
||||
// probeGPU queries nvidia-smi for temperature and utilisation.
|
||||
// Returns (nil, nil) when no NVIDIA GPU is present or nvidia-smi is absent.
|
||||
func probeGPU() (tempC, usagePct *int) {
|
||||
out, err := exec.Command(
|
||||
"nvidia-smi",
|
||||
"--query-gpu=temperature.gpu,utilization.gpu",
|
||||
"--format=csv,noheader,nounits",
|
||||
).Output()
|
||||
var out []byte
|
||||
var err error
|
||||
if runtime.GOOS == "windows" {
|
||||
out, err = deploy.HiddenOutput(
|
||||
"nvidia-smi",
|
||||
"--query-gpu=temperature.gpu,utilization.gpu",
|
||||
"--format=csv,noheader,nounits",
|
||||
)
|
||||
} else {
|
||||
out, err = exec.Command(
|
||||
"nvidia-smi",
|
||||
"--query-gpu=temperature.gpu,utilization.gpu",
|
||||
"--format=csv,noheader,nounits",
|
||||
).Output()
|
||||
}
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user