You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix CI driver builds after Ubuntu runner kernel updates - #3263
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.
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.
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.
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.
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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