mirror of
https://github.com/flatcar/scripts.git
synced 2026-02-26 18:11:45 +01:00
setup-nvidia: Stop when NVIDIA sysext is loaded
Don't build NVIDIA drivers when the flatcar-nvidia-drivers sysext is loaded, only load the prebuilt modules. Also make the nvidia.service run after the sysexts are merged. Otherwise, it might start building the modules and conflict with the prebuilt drivers sysext.
This commit is contained in:
parent
4efb615a55
commit
5f54ecfd9e
35
sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers-service/files/bin/setup-nvidia
vendored
Normal file → Executable file
35
sdk_container/src/third_party/coreos-overlay/x11-drivers/nvidia-drivers-service/files/bin/setup-nvidia
vendored
Normal file → Executable file
@ -97,20 +97,30 @@ EOF
|
||||
}
|
||||
|
||||
function install_and_load() {
|
||||
# This creates symlinks to sonames
|
||||
mkdir -p /etc/ld.so.conf.d/
|
||||
echo "/opt/nvidia/${NVIDIA_CURRENT_INSTALLATION}/usr/lib64" > /etc/ld.so.conf.d/nvidia.conf
|
||||
ldconfig
|
||||
|
||||
modprobe -a i2c_core ipmi_msghandler ipmi_devintf
|
||||
# This is needed on amd64 due to CONFIG_ACPI_VIDEO=m
|
||||
modprobe -q video || true
|
||||
|
||||
pushd "/opt/nvidia/${NVIDIA_CURRENT_INSTALLATION}/usr/lib/modules/$(uname -r)/video/"
|
||||
insmod nvidia.ko
|
||||
insmod nvidia-modeset.ko
|
||||
insmod nvidia-uvm.ko
|
||||
popd
|
||||
if systemd-sysext list | grep -q flatcar-nvidia-drivers; then
|
||||
modprobe nvidia
|
||||
modprobe nvidia-modeset
|
||||
modprobe nvidia-uvm
|
||||
|
||||
systemctl daemon-reload
|
||||
# create the nvpd user
|
||||
systemd-sysusers
|
||||
else
|
||||
# This creates symlinks to sonames
|
||||
mkdir -p /etc/ld.so.conf.d/
|
||||
echo "/opt/nvidia/${NVIDIA_CURRENT_INSTALLATION}/usr/lib64" > /etc/ld.so.conf.d/nvidia.conf
|
||||
|
||||
pushd "/opt/nvidia/${NVIDIA_CURRENT_INSTALLATION}/usr/lib/modules/$(uname -r)/video/"
|
||||
insmod nvidia.ko
|
||||
insmod nvidia-modeset.ko
|
||||
insmod nvidia-uvm.ko
|
||||
popd
|
||||
fi
|
||||
ldconfig
|
||||
|
||||
# based on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-verifications
|
||||
if [ ! -c /dev/nvidiactl ]
|
||||
@ -161,6 +171,11 @@ function is_nvidia_installation_required() {
|
||||
if [[ -d "/opt/nvidia/${NVIDIA_FLATCAR_VERSION_PAIR}" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if systemd-sysext list | grep -q flatcar-nvidia-drivers; then
|
||||
echo "Pre-build NVIDIA drivers sysext is loaded, skipping drivers build."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function presetup() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=NVIDIA Configure Service
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
After=network-online.target systemd-sysext.service
|
||||
Before=containerd.target
|
||||
|
||||
[Service]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user