Skip to content

Commit

Permalink
sle15: Do not install distro version of open driver when building one…
Browse files Browse the repository at this point in the history
… from CUDA

The SUSE's version of the NVIDIA driver has 'Supplements:' on PCI device
IDs. These cause the open driver to be installed on machines which happen
to have a matching NVIDIA card when the kernel is installed.
Use a not-well-known trick to work around this.

Signed-off-by: Egbert Eich <[email protected]>
  • Loading branch information
e4t committed Sep 20, 2024
1 parent 4aacc41 commit ae947a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sle15/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ _install_prerequisites() (

echo "Installing Linux kernel source..."
local version_without_flavor=$(echo ${KERNEL_VERSION} | cut -d- -f-2)
export ZYPP_MODALIAS_SYSFS=$(mktemp /tmp/modalias-XXXX)
if ! zypper --non-interactive in -y --no-recommends --capability kernel-${FLAVOR} = ${version_without_flavor} kernel-${FLAVOR}-devel = ${version_without_flavor} ; then
echo "FATAL: failed to install kernel packages. Ensure SLES subscription is available."
rm -f ${ZYPP_MODALIAS_SYSFS}
exit 1
fi
rm -f ${ZYPP_MODALIAS_SYSFS}; unset ZYPP_MODALIAS_SYSFS

echo "Generating Linux kernel version string..."
extract-vmlinux /boot/vmlinuz-${KERNEL_VERSION} | strings | grep -E '^Linux version' | sed 's/^\(.*\)\s\+(.*)$/\1/' > version
Expand Down

0 comments on commit ae947a1

Please sign in to comment.