Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions cuda_bindings/tests/nvml/test_pynvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# A set of tests ported from https://github.com/gpuopenanalytics/pynvml/blob/11.5.3/pynvml/tests/test_nvml.py

import os
import time

import pytest

Expand Down Expand Up @@ -150,23 +149,6 @@ def test_device_get_power_usage(ngpus, handles, subtests):
assert power_mwatts >= 0.0


def test_device_get_total_energy_consumption(ngpus, handles, subtests):
for i in range(ngpus):
with subtests.test(device_index=i):
with unsupported_before(handles[i], None):
energy_mjoules1 = nvml.device_get_total_energy_consumption(handles[i])

for _ in range(10): # idle for 150 ms
time.sleep(0.015) # and check for increase every 15 ms
with unsupported_before(handles[i], None):
energy_mjoules2 = nvml.device_get_total_energy_consumption(handles[i])
assert energy_mjoules2 >= energy_mjoules1
if energy_mjoules2 > energy_mjoules1:
break
else:
raise AssertionError("energy did not increase across 150 ms interval")


# [Skipping] pynvml.nvmlDeviceGetGpuOperationMode
# [Skipping] pynvml.nvmlDeviceGetCurrentGpuOperationMode
# [Skipping] pynvml.nvmlDeviceGetPendingGpuOperationMode
Expand Down
Loading