Comment 6 for bug 1732206

Revision history for this message
David Coronel (davecore) wrote :

My last comment #5 still stands. My tests show that this fix works for the cloud image of Ubuntu, but there are use cases where users need the nvidia drivers for GPU processing but are not running a display manager on the machine. In such a case, the display-manager.service systemd service will not exist and the deferred DKMS build will not happen because its Before attribute is set to "display-manager.service oem-config.service".

Here are the steps to see this (using the xenial cloud image :

$ sudo apt update
$ sudo touch /tmp/do_not_build_dkms_module
$ sudo vi /etc/apt/sources.list # adding xenial-proposed
$ sudo apt update
$ sudo apt install nvidia-384

ubuntu@xenialoem4:~$ cat /lib/systemd/system/nvidia-384.service
# Warning: This file is autogenerated by nvidia-384. All changes to this file will be lost.

[Unit]
Description=Detect the available GPUs and deal with any system changes
Before=display-manager.service oem-config.service

[Service]
Type=oneshot
ExecStart=/bin/sh -ec ' /usr/sbin/dkms add -m nvidia-384 -v 384.90; /usr/lib/dkms/dkms_autoinstaller start || ( rm -f /lib/systemd/system/nvidia-384.service && exit 1 ); /sbin/modprobe nvidia-384 || true ; /bin/systemctl disable nvidia-384.service || true ; rm -f /lib/systemd/system/nvidia-384.service'

[Install]
WantedBy=display-manager.service oem-config.service

==============

The oem-config service doesn't exist on the machine in that use case. The oem-config portion ran in a previous boot and the user now wants to install the nvidia driver. There is no display manager on that machine (ie. no gdm or lightdm) so the nvidia-384.service will never run.

I think this nvidia-384.service needs to be bound to a different service that will always run at the next boot.