Repository navigation
ci: gate on KFD IOCTL version in driver/GPU sanity check - #7360
Conversation
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
|
Quick test for now. |
|
Looks like the GPU sanity checks are running even on CPU runners. That doesn't seem right. |
1c763e0 to
fbc73b6
Compare
fbc73b6 to
c6d472e
Compare
2cfe1a8 to
c920b0b
Compare
c920b0b to
43e2b0b
Compare
43e2b0b to
f2af63f
Compare
3e6a4dd to
3a7ae10
Compare
ScottTodd
left a comment
There was a problem hiding this comment.
Code changes LGTM % the workflow and comment details.
821b3e3 to
f995d75
Compare
|
Looks like CI is a bit flakey. |
Extends print_driver_gpu_info.py to query the KFD IOCTL version from /dev/kfd and log it alongside the existing amd-smi and rocminfo output. The check is informational only: it warns when the version falls outside the range rocdbgapi requires (>= 1.13, < 2.0) but never fails the step. Removes the standalone print_kfd_version.py and the separate KFD version check step from test_component.yml, test_pytorch_wheels.yml, and test_multi_arch_linux_jax_wheels.yml. Also emits a run_gpu_sanity_check boolean from fetch_test_configurations.py so the sanity job in test_artifacts.yml is skipped cleanly for CPU-only families. Co-Authored-By: Claude <noreply@anthropic.com>
Drop the run_gpu_sanity_check output variable from fetch_test_configurations.py and test_artifacts.yml per Scott's suggestion. The test_sanity_check job now gates directly on fromJSON(sanity_component).test_runner, which is already non-empty only on GPU runners. Also fix the print_driver_gpu_info.py docstring, which incorrectly claimed the script always exits 0. Since PR #6604 the run_command() calls use check=True, so driver failures produce a non-zero exit. Co-Authored-By: Claude <noreply@anthropic.com>
The check now returns 1 (and the script exits non-zero) when /dev/kfd is missing, when the ioctl fails, or when the version falls outside the supported range for rocdbgapi (>= 1.13, < 2.0). Previously these were logged as warnings but never failed the sanity job. Co-Authored-By: Claude <noreply@anthropic.com>
A version below the minimum still hard-fails because it is known to produce broken rocdbgapi output. A version above the rocdbgapi tested ceiling may still work and should not block testing, so it now logs a warning and continues. Co-Authored-By: Claude <noreply@anthropic.com>
f995d75 to
bfbeba1
Compare
ROCm#7360 added a module-level `import fcntl` to print_driver_gpu_info.py. fcntl is a Unix-only module, so the Driver / GPU sanity check step now crashes on every Windows CI runner with ModuleNotFoundError: No module named 'fcntl', failing sanity and skipping all Windows component tests. The KFD ioctl query that needs fcntl only runs on Linux (/dev/kfd), so move the import into _get_kfd_version() where it is used. No behavior change on Linux; Windows now runs the sanity check to completion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| but does not fail. | ||
| """ | ||
|
|
||
| import fcntl |
There was a problem hiding this comment.
This import fails on Windows, and sanity checks failed on Windows on this PR's presubmit run: https://github.com/ROCm/TheRock/actions/runs/33499470761/job/99867709885.
Fixing in #7820
cc @amd-justchen , see https://github.com/ROCm/TheRock/blob/main/docs/rfcs/RFC0002-MonoRepo-Gardener-Rotations.md#responsibilities-and-priorities
Responsibilities and priorities
- When regressions occur that break CI workflows
- Communicate that something is broken
- Identify the culprit commit(s)
- Notify the authors/reviewers of those commits
- Revert those changes
- If it's not obvious how to, facilitate getting changes in to get back to green (see 2)
The general sequence is "comment on the PR about the break" --> "revert" --> "let the author fix"
There was a problem hiding this comment.
We can also add a unit test for this script that at least checks that it can be run on CPU runners without failing at import time (CPU runners won't have the tools, so those calls could be mocked out)
There was a problem hiding this comment.
These shouldn't be running on CPU runners at all.
There was a problem hiding this comment.
We missed this because the "Windows::release / Test gfx110X-all / Test Sanity Check / Test sanity (shard 1/1) (gfx110X-all)" job that failed ran 2 hours after the CI started and was not blocking. The "unit tests" job runs in < 5 minutes and is blocking, but it only runs on CPU (github-hosted) runners. A unit test that checked that the script could import on windows and linux would have caught this and blocked the merge.
There was a problem hiding this comment.
Ok, yeah that makes sense. I had the context wrong at first. Let me craft a PR for that.
…eck (#7820) ## Motivation #7360 added a module-level `import fcntl` to `build_tools/print_driver_gpu_info.py`. `fcntl` is a **Unix-only** stdlib module, so the `Driver / GPU sanity check` step (which runs this script) now crashes at import time on **every Windows CI runner**: ``` Traceback (most recent call last): File "...\build_tools\print_driver_gpu_info.py", line 23, in <module> import fcntl ModuleNotFoundError: No module named 'fcntl' ``` That fails the Windows sanity job and skips every downstream Windows component test. The only use of `fcntl` is in `_get_kfd_version()`, which reads the KFD ioctl version from `/dev/kfd` and is only reached on the Linux path -- Windows should never have imported the module. ISSUE ID: N/A (regression from #7360) ## Technical Details Move `import fcntl` out of module scope into `_get_kfd_version()`, its sole user. That function only runs on Linux, so the Unix-only import now happens only where it is valid. No functional change on Linux. ## Test Plan - Import + run `print_driver_gpu_info.py` on Windows Server 2025, before vs after. - Confirm the Linux KFD path is unchanged (import still resolves inside the function that uses it). ## Test Result - Windows, **before**: `ModuleNotFoundError: No module named 'fcntl'` at import. - Windows, **after**: script imports and runs to completion (exit 0), taking the `hipInfo.exe` path and skipping the Linux-only KFD block. - The equivalent pre-#7360 sanity path (identical apart from this import) already passes `Driver / GPU sanity check` and runs the `origami` gfx1201 component test green on a Windows R9700 runner. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Summary Adds a test that imports `print_driver_gpu_info` on any platform. This catches top-level use of Unix-only stdlib modules (like `fcntl`) that would crash a Windows job at import time. The test runs on CPU-only runners and blocks a merge before any GPU job has a chance to fail. Follows up on the discussion in #7360. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Extends
build_tools/print_driver_gpu_info.pyto query the KFD IOCTLversion from
/dev/kfdand log it alongside the existing amd-smi androcminfo output. The sanity job now exits non-zero when the version falls
below the minimum rocdbgapi requires (>= 1.13), when
/dev/kfdismissing, or when the ioctl call fails. A version above the tested ceiling
(>= 2.0) produces a warning in the log but does not block testing, since
it may still work fine in practice.
The
test_sanity_checkjob intest_artifacts.ymlis gated directlyon
fromJSON(sanity_component).test_runner, removing the separaterun_gpu_sanity_checkoutput variable that was introduced in an earlieriteration of this PR.
Motivation
CI runs on runners with old KFD drivers (e.g. version 1.6) were producing
a cryptic rocdbgapi failure:
Surfacing the KFD version in the existing sanity step makes mismatches
immediately visible in CI logs and blocks further testing on a runner that
would produce misleading results. CPU-only runners are unaffected because
the KFD section only runs on Linux with a GPU runner.
ISSUE ID: N/A