Skip to content

Fix CI driver builds after Ubuntu runner kernel updates - #3263

Merged
jpascucci-nv merged 3 commits into
NVIDIA:mainfrom
jpascucci-nv:gpu_failure
Oct 28, 2026
Merged

jpascucci-nv merged 3 commits into
NVIDIA:mainfrom
jpascucci-nv:gpu_failure

Conversation

@jpascucci-nv

@jpascucci-nv jpascucci-nv commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

closes #3211

Detect the kernel’s GCC major version from /proc/version, install matching gcc/g++ packages, and export CC/CXX for the driver build. Preserve existing compiler selection on older kernels. This addresses the 580.65.06 DKMS failure on 6.8.0-147, where GCC 13 rejects the kernel’s GCC 14 compiler flags, while retaining older-driver coverage. Validated shell syntax, lint, and eight mocked regression cases. Live GPU validation remains pending CI.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

For kernels newer than 6.8.0-142, detect the kernel’s GCC major version from /proc/version, install matching gcc/g++ packages, and export CC/CXX for the driver build. Preserve existing compiler selection on older kernels.
This addresses the 580.65.06 DKMS failure on 6.8.0-147, where GCC 13 rejects the kernel’s GCC 14 compiler flags, while retaining older-driver coverage.
Validated shell syntax, lint, and eight mocked regression cases. Live GPU validation remains pending CI.
@jpascucci-nv jpascucci-nv added this to the cuda.core 1.3.0 milestone Oct 28, 2026
@jpascucci-nv
jpascucci-nv requested a review from juenglin October 28, 2026 16:18
@jpascucci-nv jpascucci-nv self-assigned this Oct 28, 2026
@jpascucci-nv jpascucci-nv added the CI/CD CI/CD infrastructure label Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • GPU driver installation now selects a compiler compatible with the running kernel when its version can be detected and differs from the default.
    • If the kernel version cannot be detected, or the compiler versions already match, installation continues with the existing compiler selection.
    • This helps avoid compiler mismatches during driver installation while preserving the existing behavior when no adjustment is needed.

host_install installs build-essential first. It compares the detected kernel GCC major version with the default, installs matching GCC and G++ packages when they differ, and sets CC and CXX before installing DKMS and kernel headers.

Changes: GPU driver build dependencies

Layer / File(s) Summary
Kernel-aware compiler selection
ci/tools/install_gpu_driver.sh
host_install separates build-essential installation from DKMS and kernel-header installation. When the detected kernel GCC major version differs from the default, it installs matching GCC and G++ packages and sets CC and CXX.

Assessment against linked issues

Objective Addressed Explanation
Restore successful scheduled optional-deps CI runs [#3211] ❓ The issue does not identify the failure cause, so the available context cannot confirm that this compiler change resolves it.

Suggested reviewers: leofang

Priority: Normal

Change: Bug fix

Merge Risk: Low · up to 1cfdc

A future kernel metadata format change could silently break GPU driver builds; the small fail-closed fix should be applied before or shortly after merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

Comment thread ci/tools/install_gpu_driver.sh Outdated
@jpascucci-nv
jpascucci-nv enabled auto-merge (squash) October 28, 2026 16:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e912fa5 and 97c7336.

Files selected for processing: 1
  • ci/tools/install_gpu_driver.sh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

Comment thread ci/tools/install_gpu_driver.sh Outdated
apt-get -y install build-essential dkms "linux-headers-$(uname -r)" psmisc kmod
local kernel_release kernel_gcc default_gcc
kernel_release=$(uname -r)
apt-get -y install build-essential dkms "linux-headers-${kernel_release}" psmisc kmod

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Stability & Availability · Quick win

Supported by static analysis

Script executed:

gh run view 40620830773 --attempt 1 --log |
  rg -ni -C 3 'linux-headers|dkms|gcc|apt-get'

Repository: NVIDIA/cuda-python

Length of output: 261


Script executed:

nl -ba ci/tools/install_gpu_driver.sh | sed -n '60,140p'
rg -n -F -e 'dkms' -e 'CC=' -e 'CXX' -e 'linux-headers' -- ci/ || test "$?" -eq 1

Repository: NVIDIA/cuda-python

Length of output: 4506


important: Install the compiler before the DKMS and kernel headers.

Line 95 installs dkms and linux-headers-${kernel_release} before the compiler selection on lines 98-106. Installing headers can run dkms autoinstall for registered modules through the dkms package's header hook. That build uses the default compiler, not the CC/CXX exported on line 104. The GCC 14 flags can then fail this step, the same way the PR reports. The gcc -dumpversion call on line 99 requires build-essential, so install that package first, select the compiler, and then install dkms and the headers.

🐛 Suggested fix
--- "a/ci/tools/install_gpu_driver.sh"
+++ "b/ci/tools/install_gpu_driver.sh"
@@ -92,18 +92,20 @@
 host_install() {
   local kernel_release kernel_gcc default_gcc
   kernel_release=$(uname -r)
-  apt-get -y install build-essential dkms "linux-headers-${kernel_release}" psmisc kmod
+  apt-get -y install build-essential
 
   # Match the kernel's GCC major only when the default compiler differs.
   kernel_gcc=$(sed -nE 's/.*gcc(-[0-9]+)? (\([^)]*\) )?([0-9]+)\..*/\3/p' /proc/version)
   default_gcc=$(gcc -dumpversion | cut -d. -f1)
   echo "Kernel ${kernel_release}: GCC major=${kernel_gcc:-unknown}, default GCC major=${default_gcc}" >&2
   if [ -n "$kernel_gcc" ] && [ "$kernel_gcc" != "$default_gcc" ]; then
     apt-get -y install "gcc-${kernel_gcc}" "g++-${kernel_gcc}"
     # Installing a versioned compiler does not change the default; select it for DKMS.
     export CC="gcc-${kernel_gcc}" CXX="g++-${kernel_gcc}"
     echo "Kernel ${kernel_release}: using CC=${CC} CXX=${CXX}" >&2
   fi
+
+  apt-get -y install dkms "linux-headers-${kernel_release}" psmisc kmod
 
   # Download and verify the installer before tearing down the existing
   # host driver so a download failure or SHA-256 mismatch leaves the

Source: Path instructions

@jpascucci-nv
jpascucci-nv disabled auto-merge October 28, 2026 16:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 97c7336 and 1cfdc45.

Files selected for processing: 1
  • ci/tools/install_gpu_driver.sh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Comment thread ci/tools/install_gpu_driver.sh
@jpascucci-nv
jpascucci-nv enabled auto-merge (squash) October 28, 2026 18:19
@jpascucci-nv
jpascucci-nv merged commit 22e4c1a into NVIDIA:main Oct 28, 2026
152 of 154 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 29, 2026
Removed preview folders for the following PRs:
- PR #3103
- PR #3170
- PR #3224
- PR #3241
- PR #3250
- PR #3263
- PR #3264
- PR #3270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI failure] CI: Nightly optional-deps scheduled runs

2 participants