mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-02 02:03:21 +00:00
python3Packages.pynvml: add a gpu test
This commit is contained in:
parent
b9299696ab
commit
7ed2cba5e8
@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
substituteAll,
|
||||
pythonOlder,
|
||||
@ -50,6 +51,9 @@ buildPythonPackage rec {
|
||||
# OSError: /run/opengl-driver/lib/libnvidia-ml.so.1: cannot open shared object file: No such file or directory
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests.nvmlInit = callPackage ./test-gpu.nix { };
|
||||
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python bindings for the NVIDIA Management Library";
|
||||
homepage = "https://github.com/gpuopenanalytics/pynvml";
|
||||
|
23
pkgs/development/python-modules/pynvml/test-gpu.nix
Normal file
23
pkgs/development/python-modules/pynvml/test-gpu.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{ runCommandNoCC
|
||||
, python
|
||||
}:
|
||||
|
||||
runCommandNoCC "pynvml-gpu-test"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
(python.withPackages (ps: [ ps.pynvml ]))
|
||||
];
|
||||
requiredSystemFeatures = [
|
||||
"cuda"
|
||||
];
|
||||
} ''
|
||||
python3 << EOF
|
||||
import pynvml
|
||||
from pynvml.smi import nvidia_smi
|
||||
|
||||
pynvml.nvmlInit()
|
||||
EOF
|
||||
|
||||
touch $out
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user