MCPcopy Create free account
hub / github.com/Kaggle/docker-python / getAcceleratorName

Function getAcceleratorName

tests/common.py:7–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import subprocess
6
7def getAcceleratorName():
8 try:
9 deviceName = subprocess.check_output(['nvidia-smi', '--query-gpu=name', '--format=csv,noheader'])
10 return deviceName.decode('utf-8').strip()
11 except FileNotFoundError:
12 return("nvidia-smi not found.")
13
14def isGPU():
15 return os.path.isfile('/proc/driver/nvidia/version')

Callers 1

common.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected