Skip to content

Commit

Permalink
Add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywonchung committed Sep 10, 2024
1 parent b89df19 commit 2c6bdc2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions zeus/device/gpu/nvidia.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from __future__ import annotations

import functools
import os
import warnings
import functools
import contextlib
from pathlib import Path
from typing import Sequence
Expand Down Expand Up @@ -214,7 +215,13 @@ def getAverageMemoryPowerUsage(self) -> int:
)[0]
if (ret := metric.nvmlReturn) != pynvml.NVML_SUCCESS:
raise pynvml.NVMLError(ret)
return metric.value.uiVal
power = metric.value.uiVal
if power == 0:
warnings.warn(
"Average memory power returned 0. The current GPU may not be supported.",
stacklevel=1,
)
return power

@_handle_nvml_errors
def supportsGetTotalEnergyConsumption(self) -> bool:
Expand Down

0 comments on commit 2c6bdc2

Please sign in to comment.