Skip to content

Commit

Permalink
update with cuda12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenAiUppa committed Nov 28, 2024
1 parent fc240b9 commit e8d5634
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deep_learning_power_measure/power_measure/gpu_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def get_gpu_use(gpu):

def get_gpu_power(gpu):
"""get the power draw for this gpu"""
power_readings = gpu.findall("power_readings")[0]
power_readings = gpu.findall("power_readings")
if len(power_readings) == 0:
power_readings = gpu.findall("gpu_power_readings")
power_readings = power_readings[0]
power_draw = power_readings.findall("power_draw")[0].text
if power_draw == 'N/A':
raise RuntimeError("nvidia-smi could not retrieve power draw from the nvidia card. Check that it is supported on your hardware ?")
Expand Down Expand Up @@ -170,7 +173,10 @@ def get_min_power():
min_powers = {}
xml = get_nvidia_xml()
for gpu_id, gpu in enumerate(xml.findall("gpu")):
power_readings = gpu.findall("power_readings")[0]
power_readings = gpu.findall("power_readings")
if len(power_readings) == 0:
power_readings = gpu.findall("gpu_power_readings")
power_readings = power_readings[0]
power_min = power_readings.findall("min_power_limit")[0].text
min_powers[gpu_id] = float(power_min.replace('W',''))
return min_powers
Expand Down

0 comments on commit e8d5634

Please sign in to comment.