Skip to content

Commit

Permalink
Improve log messages for nvidia clocks
Browse files Browse the repository at this point in the history
  • Loading branch information
deiteris committed Aug 3, 2024
1 parent 878669c commit b97d9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/voice_changer/common/deviceManager/DeviceManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def reset_nvidia_clocks(self, device_id: int | None = None):
if self.device.type != 'cuda':
return
device_id = self.device.index
logger.info(f"Resetting core/memory frequencies for cuda:{device_id}...")
logger.info(f"Resetting core/memory clocks for cuda:{device_id}...")
subprocess.call(shlex.split(NVSMI_RESET_GPU_CLOCKS % self.device.index), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
subprocess.call(shlex.split(NVSMI_RESET_MEMORY_CLOCKS % self.device.index), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)

Expand All @@ -83,7 +83,7 @@ def force_nvidia_clocks(self, device: torch.device):
output = subprocess.check_output(shlex.split(NVSMI_QUERY_DEVICE_CLOCKS % device.index))
lines = output.decode("utf-8").split(os.linesep)
gpu_clock, memory_clock = lines[0].split(', ')
logger.info(f"Using core/memory clocks: {gpu_clock} MHz / {memory_clock} MHz")
logger.info(f"Setting core/memory clocks for cuda:{device.index}: {gpu_clock} MHz / {memory_clock} MHz")
subprocess.call(shlex.split(NVSMI_LOCK_GPU_CLOCKS % (device.index, int(gpu_clock))), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
subprocess.call(shlex.split(NVSMI_LOCK_MEMORY_CLOCKS % (device.index, int(memory_clock))), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)

Expand Down

0 comments on commit b97d9d4

Please sign in to comment.