Skip to content

Commit 3cc4edb

Browse files
authored
[no-ci] Display the logs when driver installation fails (#3287)
Print the nvidia installer and dkms build logs on failure.
1 parent 14fedab commit 3cc4edb

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎ci/tools/install_gpu_driver.sh‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,21 @@ host_install() {
137137

138138
( cd "$d" \
139139
&& sh installer.run --silent --dkms --no-questions \
140-
--accept-license --ui=none --no-cc-version-check --kernel-module-type="$KMT" )
140+
--accept-license --ui=none --no-cc-version-check --kernel-module-type="$KMT" ) || {
141+
local installer_status=$? log
142+
echo "::error::NVIDIA driver installer exited with status ${installer_status}" >&2
143+
# The silent installer reports only a summary; expose the actual build errors.
144+
for log in /var/log/nvidia-installer.log \
145+
/var/lib/dkms/nvidia*/"$VERSION"/build/make.log \
146+
/var/lib/dkms/nvidia*/"$VERSION"/*/*/log/make.log; do
147+
if [ -f "$log" ]; then
148+
echo "::group::${log}"
149+
cat "$log" || echo "::warning::could not read ${log}" >&2
150+
echo "::endgroup::"
151+
fi
152+
done
153+
return "$installer_status"
154+
}
141155
modprobe nvidia nvidia_uvm nvidia_modeset
142156

143157
# Bring nvidia-persistenced back up. NVML state-changing calls from

0 commit comments

Comments
 (0)