Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.4 kB · 64 lines
Nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465{ lib, fetchPypi, buildPythonPackage, replaceVars, addDriverRunpath, setuptools, cudaPackages, nvidia-ml-py,}:
buildPythonPackage rec { pname = "nvidia-ml-py"; version = "12.575.51";
pyproject = true;
src = fetchPypi { pname = "nvidia_ml_py"; inherit version; hash = "sha256-ZJDpP+qZ606WYyeuGMbuxiVhlMkh8jRZyHZ67ijFRYE="; };
patches = [ (replaceVars ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch { inherit (addDriverRunpath) driverLink; }) ];
build-system = [ setuptools ];
# no tests doCheck = false;
pythonImportsCheck = [ "pynvml" ];
passthru.tests.tester-nvmlInit = cudaPackages.writeGpuTestPython { libraries = [ nvidia-ml-py ]; } '' from pynvml import ( nvmlInit, nvmlSystemGetDriverVersion, nvmlDeviceGetCount, nvmlDeviceGetHandleByIndex, nvmlDeviceGetName, )
nvmlInit() print(f"Driver Version: {nvmlSystemGetDriverVersion()}")
for i in range(nvmlDeviceGetCount()): handle = nvmlDeviceGetHandleByIndex(i) print(f"Device {i} : {nvmlDeviceGetName(handle)}") '';
meta = { description = "Python Bindings for the NVIDIA Management Library"; homepage = "https://pypi.org/project/nvidia-ml-py"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ GaetanLepage ]; };}