Skip to content
Merged
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
7 changes: 5 additions & 2 deletions cuda_bindings/tests/nvml/test_compute_mode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE


Expand All @@ -25,8 +25,11 @@ def test_compute_mode_supported_nonroot(all_devices):
continue

for cm in COMPUTE_MODES:
with pytest.raises(nvml.NoPermissionError):
try:
nvml.device_set_compute_mode(device, cm)
except nvml.NoPermissionError:
skip_reasons.add(f"nvmlDeviceSetComputeMode requires root for device {device}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this got passed the CI, but it failed on main:

                except nvml.NoPermissionError:
>                   skip_reasons.add(f"nvmlDeviceSetComputeMode requires root for device {device}")
                    ^^^^^^^^^^^^
E                   NameError: name 'skip_reasons' is not defined

https://github.com/NVIDIA/cuda-python/actions/runs/21307037717/job/61337052365#step:26:510

continue
assert original_compute_mode == nvml.device_get_compute_mode(device), "Compute mode shouldn't have changed"

if skip_reasons:
Expand Down
Loading