Skip to content

CI: run the privileged NVML tests (PRM, power limit) on a runner with root access #3582

Todo

Description

@mdboom

Part of #2077.

Problem

Three NVML tests change device state and need root (or an equivalent privilege), which most CI runners don't have:

Test Result in CI
cuda_bindings_13/tests/nvml/test_device.py::test_read_write_prm GB300 (nightly): NoPermissionError ("No permission to read/write PRM"). RTX PRO 6000 and all other GPUs: NotSupported. So it needs datacenter Blackwell and root.
cuda_bindings_{12,13}/tests/nvml/test_device.py::test_set_power_management_limit Linux and WSL: NoPermissionError. Windows and the Linux 610.43.02 custom-driver rows have permission but request an invalid limit; #3564 fixes that.
cuda_bindings_12/tests/nvml/test_compute_mode.py::test_compute_mode_supported_nonroot Linux: "Insufficient permissions to set compute mode". Windows: skipped by design. The cuda_bindings_13 copy passes on the two Linux 610.43.02 custom-driver rows, which run nvidia-persistenced as root, but no CUDA 12 row uses that setup.

Proposal

Run these tests on a job that has the needed privilege:

These calls change GPU state on shared runners. Run them serialized, restore state afterwards (the power-limit fix does this), and confirm with the runner team that root NVML access is acceptable on that runner.

Done when

test_read_write_prm passes on a privileged datacenter Blackwell row, test_set_power_management_limit passes on at least one Linux row, the CUDA 12 test_compute_mode_supported_nonroot passes on a CUDA 12 row, and the "not currently run in any CI job" markers on these tests are removed.

Guidance for PRs that address this issue

  • When making a fix that allows a test to run in CI, remove the comment about the test not running in CI from the code.
  • When making a test run only in nightly CI, we need to concretely confirm that in nightly CI. Include instructions in the PR about how to kick off a nightly run for the specific PR in order to test that (see below).
  • For every PR note that the reviewer should feel free to push commits directly to the PR to improve things. @mdboom does not have the bandwidth to shepard each of them through.
  • Every PR should include a way to confirm automatically that the tests are now running in at least one CI configuration.

Running the nightly test suites for a PR

The nightly workflow can test a PR's own wheels and tests, but it has to be started by hand. Starting it needs write access to NVIDIA/cuda-python, so ask a maintainer if you don't have it.

  1. Wait for the PR's CI workflow run to finish successfully, and note its run ID, the number in its URL (.../actions/runs/<run-id>).

  2. Start CI: Nightly optional-deps on the PR's mirror branch, with that run ID. Either:

    • In the GitHub UI: Actions → CI: Nightly optional-deps → Run workflow. Set Use workflow from to pull-request/<PR number>, enter the run ID in the run-ID field, and leave the link-checker-only box unchecked.

    • From the command line:

      gh workflow run ci-nightly.yml --repo NVIDIA/cuda-python --ref pull-request/<PR number> -f run-id=<run-id>
      

    Supply the run ID. Without it, the nightly run tests main's latest wheels and tests, not the PR's.

  3. Link the nightly run in the PR. Then confirm that the affected tests ran and passed, rather than skipped, in the relevant nightly jobs.

The nightly run tests the commit of that CI run. Repeat these steps after pushing changes that affect the nightly-only tests.

Activity

  1. added
    CI/CD
    test
    cuda.bindings
    on Nov 25, 2026
  2. self-assigned this
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CI/CDcuda.bindingsnvidia-runnerstest

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions