MCPcopy Create free account
hub / github.com/RightNow-AI/rightnow-cli / detect_gpu_info

Function detect_gpu_info

rightnow_cli/cli_minimal.py:107–126  ·  view source on GitHub ↗

Detect GPU and CUDA information.

()

Source from the content-addressed store, hash-verified

105
106
107def detect_gpu_info():
108 """Detect GPU and CUDA information."""
109 try:
110 import subprocess
111
112 # Try nvidia-smi to get GPU name
113 result = subprocess.run(
114 ['nvidia-smi', '--query-gpu=name', '--format=csv,noheader'],
115 capture_output=True,
116 text=True,
117 timeout=2
118 )
119
120 if result.returncode == 0 and result.stdout.strip():
121 gpu_name = result.stdout.strip().split('\n')[0] # First GPU
122 return gpu_name, True
123 else:
124 return None, False
125 except:
126 return None, False
127
128
129def detect_cuda_version():

Callers 2

show_minimal_bannerFunction · 0.85
show_gpu_statusFunction · 0.85

Calls 1

runMethod · 0.80

Tested by

no test coverage detected