Debian Codegraph @

debian/patches/0000-No-strict-dependency-on-pynvml

raw
1 --- a/scalene/scalene_nvidia_gpu.py
2 +++ b/scalene/scalene_nvidia_gpu.py
3 @@ -3,8 +3,6 @@
4 import sys
5 from typing import Tuple
6
7 -import pynvml
8 -
9 from scalene.scalene_accelerator import ScaleneAccelerator
10
11
12 @@ -18,6 +16,7 @@
13 self.__pid = os.getpid()
14 self.__has_per_pid_accounting = False
15 with contextlib.suppress(Exception):
16 + import pynvml
17 pynvml.nvmlInit()
18 # Try to actually get utilization and memory usage.
19 # If this fails, we disable GPU profiling.