Skip to content

Commit 2a1db37

Browse files
committed
Merge remote-tracking branch 'origin/main' into ajost/vmm-redesign
2 parents f9e5940 + f59229e commit 2a1db37

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

cuda_core/tests/system/test_system_device.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ def test_device_name():
167167

168168

169169
def test_device_pci_info(subtests):
170-
for device in system.Device.get_all_devices():
170+
for cuda_device in CudaDevice.get_all_devices():
171+
device = cuda_device.to_system_device()
171172
with subtests.test(device_index=device.index):
172173
pci_info = device.pci_info
173174
assert isinstance(pci_info, _device.PciInfo)
@@ -684,7 +685,8 @@ def test_clock_event_reasons(subtests):
684685

685686

686687
def test_fan(subtests):
687-
for device in system.Device.get_all_devices():
688+
for cuda_device in CudaDevice.get_all_devices():
689+
device = cuda_device.to_system_device()
688690
device_index = device.index
689691
num_fans = None
690692
# The fan APIs are only supported on discrete devices with fans,
@@ -734,7 +736,8 @@ def test_fan(subtests):
734736

735737

736738
def test_cooler(subtests):
737-
for device in system.Device.get_all_devices():
739+
for cuda_device in CudaDevice.get_all_devices():
740+
device = cuda_device.to_system_device()
738741
with subtests.test(device_index=device.index):
739742
# The cooler APIs are only supported on discrete devices with fans,
740743
# but when they are not available `device.num_fans` returns 0.

cuda_core/tests/system/test_system_events.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import helpers
1111
import pytest
1212

13+
from cuda.core import Device as CudaDevice
1314
from cuda.core import system
1415
from cuda.core.system import typing
1516

@@ -54,10 +55,12 @@ def test_pci_bus_id_from_gpu_id(gpu_id, expected):
5455
def test_system_event_device_resolves_pci_bus_id():
5556
# Round-trip: pack pci_info with the inverse of _pci_bus_id_from_gpu_id,
5657
# then resolve Device through SystemEvent.device.
57-
if system.get_num_devices() == 0:
58-
pytest.skip("No GPUs available")
58+
cuda_devices = list(CudaDevice.get_all_devices())
59+
if not cuda_devices:
60+
pytest.skip("No CUDA devices available")
5961

60-
for device in system.Device.get_all_devices():
62+
for cuda_device in cuda_devices:
63+
device = cuda_device.to_system_device()
6164
pci = device.pci_info
6265
if pci.domain > 0xFFFF:
6366
pytest.skip(f"PCI domain {pci.domain:#x} does not fit in a packed gpu_id")

0 commit comments

Comments
 (0)