-cpu flag

This commit is contained in:
Dobromir Popov
2026-07-09 08:19:15 +03:00
parent 4ed585bf54
commit 9ec4ca9ce1
8 changed files with 121 additions and 11 deletions

View File

@@ -34,6 +34,27 @@ from meshnet_tracker.server import TrackerServer
# ---------------------------------------------------------------------------
def test_with_forced_cpu_overrides_device_but_keeps_gpu_inventory():
"""--cpu should register and run on CPU while preserving detected GPU metadata."""
import meshnet_node.hardware as hardware_mod
hw = hardware_mod.with_forced_cpu(
{
"device": "cuda",
"gpu_name": "NVIDIA GeForce RTX 4060",
"vram_mb": 8192,
"dedicated_vram_mb": 8192,
"shared_vram_mb": 0,
"ram_mb": 32768,
"cuda_available": True,
}
)
assert hw["device"] == "cpu"
assert hw["cuda_available"] is False
assert hw["gpu_name"] == "NVIDIA GeForce RTX 4060"
assert hw["vram_mb"] == 8192
def test_detect_hardware_returns_valid_profile():
"""Hardware detection always returns a dict with required keys."""
hw = detect_hardware()