Issues with loading and unloading nvidia driver modules

Bug #1999314 reported by Borodin Nikolay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-525 (Ubuntu)
New
Undecided
Unassigned

Bug Description

These problems also affect older versions of NVidia drivers.

Issue #1. The NVidia kernel driver doesn't have time to load and Xorg starts before the driver is loaded. A further restart of the X server loads the driver correctly. This problem may or may not appear depending on whether the driver has enough time to boot.

Solution: The package post-install script must add the following lines to /etc/modules and to /etc/modules.load.d/modules.conf respectively.

nvidia
nvidia-drm
nvidia-modeset

Issue #2. When the system shuts down or reboots. Warnings are thrown into the console.

This is a driver issue, which has already been reported in the open-source version of the NVidia drver.

https://github.com/NVIDIA/open-gpu-kernel-modules/issues/289

[ 281.772822] sd-umoun[3293]: Failed to unmount /oldroot: Device or resource busy
[ 281.774041] sd-umoun[3294]: Failed to unmount /oldroot/sys: Device or resource busy
[ 281.775539] shutdown[1]: Failed to finalize file systems, ignoreing.

Until this is fixed, the following workaround should be added for convenience.

1. Create file /usr/lib/systemd/system-shutdown/nvidia.shutdown and make it executable.
2. The file should have the following content.

#!/bin/sh
# Remove all Nvidia modules on shutdown
# to avoid errors like
# [35509.312925] sd-umoun[56020]: Failed to unmount /oldroot: Device or resource busy
# [35509.317505] sd-umoun[56021]: Failed to unmount /oldroot/sys: Device or resource busy
# [35509.322349] shutdown[1]: Failed to finalize file systems, ignoring.
#
for MODULE in nvidia_drm nvidia_modeset nvidia_uvm nvidia
   do
# we will have to check if the modules are still loaded because they aren't always
       if lsmod | grep "$MODULE" &> /dev/null ; then
          rmmod $MODULE
       fi
   done

OS: Ubuntu 20.04 (Focal Fossa).

Tags: dkms nvidia
description: updated
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.