Nvidia driver does not load on Ubuntu 21.04 with Geforce RTX 3060

Hi,

I am having problems with my driver in Ubuntu 21.04 with a GPU Geforce RTX 3060 on a computer with dual booting (Windows 10 and Ubuntu). I’ve seen a few very similar posts here on the forum but nothing yet has solved my issue.

I have installed the driver by all the methods I have seen online, but with all of them I get the following after introducing the command nvidia-smi:

“NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running”

Right now I am trying with the driver 460, but I have also tried with 470.

I’ve attached my bug report. If any one knows what is going on, I would really appreciate the help! :)

Thank you!
nvidia-bug-report.log.gz (77.9 KB)

Hi

I had a look at your log report and two main issues stand out, first it seems you’re trying to install the driver by executing a .run file while Ubuntu provides native packages which integrate better with your distro, second issue is that the driver version you were trying to install was 460.39 while support for GTX 3060 GPUs was added in 460.56 .

I’d recommend you eliminate these two issues first by uninstalling the current driver and reinstalling the latest version by sudo ubuntu-drivers autoinstall then if you’re still having issues, post a new bug report with that driver maybe we can get to the root of problem then.

1 Like

Hi there!

Thanks for the quick reply/help, much appreciated.

I tried your suggestion by running:

sudo apt purge '*nvidia*'
sudo ubuntu-drivers autoinstall

This is what it installed:

~ » apt list --installed | grep nvidia                                                                              9 ↵ joey@joey-g14

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnvidia-cfg1-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-common-470/hirsute,hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev all [installed,automatic]
libnvidia-compute-460/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,auto-removable]
libnvidia-compute-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-compute-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
libnvidia-decode-460/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,auto-removable]
libnvidia-decode-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-decode-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
libnvidia-encode-460/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,auto-removable]
libnvidia-encode-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-encode-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
libnvidia-extra-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-fbc1-460/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,auto-removable]
libnvidia-fbc1-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-fbc1-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
libnvidia-gl-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-gl-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
libnvidia-ifr1-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
libnvidia-ifr1-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev i386 [installed,automatic]
nvidia-compute-utils-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
nvidia-dkms-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
nvidia-driver-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed]
nvidia-kernel-common-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
nvidia-kernel-source-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
nvidia-settings/hirsute-updates,hirsute-security,now 470.57.01-0ubuntu0.21.04.1 amd64 [installed,automatic]
nvidia-utils-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]
xserver-xorg-video-nvidia-470/hirsute,now 470.57.02-1pop0~1627044105~21.04~f9815ed~dev amd64 [installed,automatic]

Still no luck after a few reboots. As far as I can tell by the results of lspci -k -v the hardware is recognized, it just doesn’t seem to be “useable” and it’s always falling back to the AMD integrated chip:

...
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. Device 1722
	Physical Slot: 0
	Flags: fast devsel, IOMMU group 8
	Memory at fb000000 (32-bit, non-prefetchable) [disabled] [size=16M]
	Memory at fc00000000 (64-bit, prefetchable) [disabled] [size=8G]
	Memory at fe00000000 (64-bit, prefetchable) [disabled] [size=32M]
	I/O ports at e000 [disabled] [size=128]
	Expansion ROM at fc000000 [virtual] [disabled] [size=512K]
	Capabilities: <access denied>
	Kernel modules: nvidiafb, nouveau

04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c4) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. Device 1722
	Flags: bus master, fast devsel, latency 0, IRQ 47, IOMMU group 5
	Memory at fe10000000 (64-bit, prefetchable) [size=256M]
	Memory at fe20000000 (64-bit, prefetchable) [size=2M]
	I/O ports at d000 [size=256]
	Memory at fc500000 (32-bit, non-prefetchable) [size=512K]
	Capabilities: <access denied>
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu
...

Additionally, I get this when trying to run nvidia-smi or view the NVIDIA X Server Settings application:

EDIT: attach a new nvidia-bug-report output
nvidia-bug-report.log.gz (95.1 KB)

It’s very strange that despite your grep nvidia output your log still indicates the previous issues:

WARNING: You do not appear to have an NVIDIA GPU supported by the 460.39 NVIDIA Linux graphics driver installed in this system.  For further details, please see the appendix SUPPORTED NVIDIA GRAPHICS CHIPS in the README available on the Linux driver download page at www.nvidia.com.
-> Installing NVIDIA driver version 460.39.
-> An alternate method of installing the NVIDIA driver was detected. (This is usually a package provided by your distributor.) A driver installed via that method may integrate better with your system than a driver installed by nvidia-installer.

Please review the message provided by the maintainer of this alternate installation method and decide how to proceed:

The NVIDIA driver provided by Ubuntu can be installed by launching the "Software & Updates" application, and by selecting the NVIDIA driver from the "Additional Drivers" tab.

Nevertheless here’s my recommedation:

  • Check your BIOS settings for the following:

    1. Primary GPU: Auto ( or Discrete if you’re going to only use your NVIDIA but power usage will increase. )
    2. CSM Support: Disabled (Usually present only when OS is set to Windows 8
    3. Secure Boot: Disabled
  • Completely remove NVIDIA drivers:

    1. sudo apt remove --purge '^nvidia-.*'
    2. sudo apt remove --purge '^libnvidia-.*'
  • Remove any residues:

    1. sudo rm /etc/X11/xorg.conf
    2. sudo rm /etc/X11/xorg.conf.d/90-nvidia-primary.conf
    3. sudo rm /usr/share/X11/xorg.conf.d/10-nvidia.conf
    4. sudo rm /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
  • Make sure NVIDIA modules are not blacklisted:

    1. grep blacklist /etc/modprobe.d/* /lib/modprobe.d/*
    2. If nvidia shows up in the above grep output , remove the corresponding blacklist file
  • Reboot

  • Update and cleanup your system

    1. sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y
  • Install NVIDIA drivers through Software & Updates → Additional Drivers Tab

  • Enable NVIDIA DRM KMS:

    1. sudo bash -c "echo options nvidia_drm modeset=1 > /etc/modprobe.d/nvidia-kms.conf"

    2. sudo update-initramfs -u

  • Reboot

  • Configure PRIME:

    1. sudo nvidia-xconfig
    2. sudo prime-select nvidia

Hi there @humblebee,

Thanks again for the help. So I went through your suggested steps one by one. No luck yet unfortunately.

I first checked my BIOS settings. Secure Boot was already disabled and I did not find settings for “CSM Support” nor “Primary GPU”.

I then went on to remove and reinstall the drivers following the steps you laid out. One thing I did notice was that nvidiafb was blacklisted, I didn’t remove this however and continued on (not sure if that would’ve had an impact):

~ » grep blacklist /etc/modprobe.d/* /lib/modprobe.d/* | grep nvidia                                                                              9 ↵ joey@joey-g14
/etc/modprobe.d/asusd.conf:#blacklist i2c_nvidia_gpu
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb

Another noticeable thing to point out was this:

~ » sudo nvidia-xconfig                                                                                                                               joey@joey-g14
[sudo] password for joey: 

WARNING: Unable to locate/open X configuration file.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
New X configuration file written to '/etc/X11/xorg.conf'

Not sure if No package 'xorg-server' found is important/relevant or can be safely ignored.

Additionally when I ran sudo prime-select nvidia it is telling me Info: the nvidia profile is already set.

nvidia-smi still complains with NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running..

I’ve attached another nvidia-bug-report.sh output below.
nvidia-bug-report.log.gz (93.6 KB)

Thanks again for the suggestions so far.

Hi there @joseph.t.orlando

You’re welcome! So following your last post, it seems like a DKMS or Xorg issue, here’s what I suggest (in this order) :

  • Blacklist Troubling Drivers

    1. sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
    2. sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
    3. sudo bash -c "echo blacklist i2c_nvidia_gpu > /etc/modprobe.d/asusd.conf"
  • Reinstall Xorg packages:

    1. sudo apt install xserver-xorg xserver-xorg-dev
  • Recreate Kernel Modules:

    1. sudo dkms remove nvidia/470.57 --all
    2. sudo dkms install --force nvidia/470.57 -k $(uname -r)
    3. sudo update-initramfs -u
    4. sync
  • Reboot

If it’s still not working try the following:

  • Fix Xorg config:

    1. sudo nano /etc/X11/xorg.conf
      add the missing entries from below to the “Device” section:
Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:2:0:0"
    Option         "AllowEmptyInitialConfiguration"
EndSection
  • Reboot

Still not working? Check out this post here