From 96392f7d0f5396c28ea62e3d597fb1f6f9f7129d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Karpel=C3=A8s?= Date: Thu, 4 Apr 2024 12:15:21 +0900 Subject: [PATCH] Update GPUtil.py to be compatible with python 3.12 --- GPUtil/GPUtil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPUtil/GPUtil.py b/GPUtil/GPUtil.py index 2d5375d..edc31e4 100644 --- a/GPUtil/GPUtil.py +++ b/GPUtil/GPUtil.py @@ -31,7 +31,7 @@ # SOFTWARE. from subprocess import Popen, PIPE -from distutils import spawn +import shutil import os import math import random @@ -70,7 +70,7 @@ def getGPUs(): # If the platform is Windows and nvidia-smi # could not be found from the environment path, # try to find it from system drive with default installation path - nvidia_smi = spawn.find_executable('nvidia-smi') + nvidia_smi = shutil.which('nvidia-smi') if nvidia_smi is None: nvidia_smi = "%s\\Program Files\\NVIDIA Corporation\\NVSMI\\nvidia-smi.exe" % os.environ['systemdrive'] else: