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
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}")
continue
assert original_compute_mode == nvml.device_get_compute_mode(device), "Compute mode shouldn't have changed"

if skip_reasons:
Expand Down
Loading