12 buildPythonPackage rec {
13 pname = "nvidia-ml-py";
14 version = "12.560.30";
19 inherit pname version;
21 hash = "sha256-8CVNx0AGR2gKBy7gJQm/1GECtgvf7KMhV21NSBfn/pc=";
26 src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch;
27 inherit (addDriverRunpath) driverLink;
38 pythonImportsCheck = [ "pynvml" ];
40 passthru.tests.tester-nvmlInit =
41 cudaPackages.writeGpuTestPython { libraries = [ nvidia-ml-py ]; }
45 nvmlSystemGetDriverVersion,
47 nvmlDeviceGetHandleByIndex,
52 print(f"Driver Version: {nvmlSystemGetDriverVersion()}")
54 for i in range(nvmlDeviceGetCount()):
55 handle = nvmlDeviceGetHandleByIndex(i)
56 print(f"Device {i} : {nvmlDeviceGetName(handle)}")
60 description = "Python Bindings for the NVIDIA Management Library";
61 homepage = "https://pypi.org/project/nvidia-ml-py";
62 license = lib.licenses.bsd3;
63 maintainers = with lib.maintainers; [ GaetanLepage ];