python312Packages.nvidia-ml-py: fix and improve test
This commit is contained in:
parent
82eb8a8f8d
commit
92c03649e3
@ -40,10 +40,20 @@ buildPythonPackage rec {
|
||||
passthru.tests.tester-nvmlInit =
|
||||
cudaPackages.writeGpuTestPython { libraries = [ nvidia-ml-py ]; }
|
||||
''
|
||||
import pynvml
|
||||
from pynvml.smi import nvidia_smi # noqa: F401
|
||||
from pynvml import (
|
||||
nvmlInit,
|
||||
nvmlSystemGetDriverVersion,
|
||||
nvmlDeviceGetCount,
|
||||
nvmlDeviceGetHandleByIndex,
|
||||
nvmlDeviceGetName,
|
||||
)
|
||||
|
||||
print(f"{pynvml.nvmlInit()=}")
|
||||
nvmlInit()
|
||||
print(f"Driver Version: {nvmlSystemGetDriverVersion()}")
|
||||
|
||||
for i in range(nvmlDeviceGetCount()):
|
||||
handle = nvmlDeviceGetHandleByIndex(i)
|
||||
print(f"Device {i} : {nvmlDeviceGetName(handle)}")
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
Loading…
Reference in New Issue
Block a user