-cpu flag
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user