Ubuntu – `nvidia-xconfig` breaks boot

18.04bootdriversnvidiaxorg

I would like to test some GPU overclocking add fan speed settings on my machine.

For that I need to enable the Coolbits option in the Device section (Enabling overclocking):

sudo nvidia-xconfig --cool-bits=12

It seems that this line above will create a xorg.conf file, but the
Coolbits option does is not written under Device, but under Screen configurations.

Even so, if I only create the xorg.conf file with sudo nvidia-xconfig, and then manually add
Option "Coolbits" "12" in the "Device" Section to make it look like this:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option         "Coolbits" "12"
EndSection

when I restart the machine, Ubuntu 18.04.4 does not get past the loading screen:
Ubuntu 18.04 hangs at boot after running `nvidia-xconfig`

Others encountered the same problem:

I couldn't find a clear solution. How can I make the nvidia-xconfig work properly?

Best Answer

Run :

sudo depmod

It will check all the module dependencies and updates the file /lib/modules/5.3.0-46-generic/modules.dep.