Nvidia-smi “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure ..."

I see that many others have reported similar problems on the forum, but none of the suggested solutions worked. I’m running Ubuntu 18.04.5 LTS. The drivers have been recently installed with ‘sudo apt install nvidia-driver-460’, though the problem existed even before. Running nvidia-smi gives the error in the title, while

ferdy@palmiro:~$ sudo nvidia-settings 

ERROR: NVIDIA driver is not loaded


ERROR: Unable to load info from any available system


(nvidia-settings:6155): GLib-GObject-CRITICAL **: 17:43:06.619: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 17:43:06.623: PRIME: No offloading required. Abort
** Message: 17:43:06.623: PRIME: is it supported? no

and prime select confirms nvidia has already been selected as a profile

ferdy@palmiro:~$ sudo prime-select nvidia
Info: the nvidia profile is already set

Here’s the output of my
ferdy@palmiro:~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 3e98
01:00.0 VGA compatible controller: NVIDIA Corporation GV104 [GeForce GTX 1180] (rev a1)
I’m also attaching the error log. Notice that secure boot is disabled.

There is no file /lib/modprobe.d/nvidia-blacklist.conf, and there never was, however I found that /etc/modprobe.d/blacklist-framebuffer.conf had a line blacklist nvidiafb. I commented the line and ran sudo update-initramfs -u, but even after reboot the problem persists.

Any help is appreciated, thanks!

nvidia-bug-report.log.gz (182.9 KB)

Your build system is broken so the driver doesn’t compile. Please post the output of
gcc -v
and
cc -v

Many thanks for the quick reply!

ferdy@palmiro:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
ferdy@palmiro:~$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.5.0-2ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~18.04)

Please set cc to gcc-7.5.0 using update-alternatives

Thanks, just did that with sudo update-alternatives --config cc. I then unistalled the drivers and reinstalled them again, but it still doesn’t seem to be working. My new logfile is attached

nvidia-bug-report.log.gz (171.9 KB)

Please post the ouput of
update-alternatives --get-selections

Thanks, here it is

animate                        auto     /usr/bin/animate-im6.q16
animate-im6                    auto     /usr/bin/animate-im6.q16
automake                       auto     /usr/bin/automake-1.15
awk                            auto     /usr/bin/mawk
builtins.7.gz                  auto     /usr/share/man/man7/bash-builtins.7.gz
c++                            auto     /usr/bin/g++
c89                            auto     /usr/bin/c89-gcc
c99                            auto     /usr/bin/c99-gcc
cc                             manual   /usr/bin/gcc
clhsdb                         auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/clhsdb
cli                            auto     /usr/bin/mono
compare                        auto     /usr/bin/compare-im6.q16
compare-im6                    auto     /usr/bin/compare-im6.q16
composite                      auto     /usr/bin/composite-im6.q16
composite-im6                  auto     /usr/bin/composite-im6.q16
conjure                        auto     /usr/bin/conjure-im6.q16
conjure-im6                    auto     /usr/bin/conjure-im6.q16
convert                        auto     /usr/bin/convert-im6.q16
convert-im6                    auto     /usr/bin/convert-im6.q16
cpp                            auto     /usr/bin/cpp
default.plymouth               auto     /usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.plymouth
display                        auto     /usr/bin/display-im6.q16
display-im6                    auto     /usr/bin/display-im6.q16
editor                         auto     /bin/nano
ex                             auto     /usr/bin/vim.basic
f77                            auto     /usr/bin/gfortran
f95                            auto     /usr/bin/gfortran
fakeroot                       auto     /usr/bin/fakeroot-sysv
from                           auto     /usr/bin/bsd-from
ftp                            auto     /usr/bin/netkit-ftp
gdm3.css                       auto     /usr/share/gnome-shell/theme/ubuntu.css
global-assembly-cache-tool     auto     /usr/bin/gacutil
gnome-text-editor              auto     /usr/bin/gedit
gnome-www-browser              auto     /usr/bin/firefox
gnuplot                        auto     /usr/bin/gnuplot-qt
gstreamer-codec-install        auto     /usr/lib/packagekit/pk-gstreamer-install
hsdb                           auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/hsdb
identify                       auto     /usr/bin/identify-im6.q16
identify-im6                   auto     /usr/bin/identify-im6.q16
import                         auto     /usr/bin/import-im6.q16
import-im6                     auto     /usr/bin/import-im6.q16
infobrowser                    auto     /usr/bin/info
jaotc                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jaotc
jar                            auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jar
jarsigner                      auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jarsigner
java                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/java
javac                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
javadoc                        auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc
javap                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/javap
jcmd                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jcmd
jconsole                       auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole
jdb                            auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jdb
jdeprscan                      auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jdeprscan
jdeps                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jdeps
jexec                          auto     /usr/lib/jvm/java-11-openjdk-amd64/lib/jexec
jfr                            auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jfr
jhsdb                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jhsdb
jimage                         auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jimage
jinfo                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jinfo
jjs                            auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs
jlink                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jlink
jmap                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jmap
jmod                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jmod
jps                            auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jps
jrunscript                     auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jrunscript
jshell                         auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jshell
jsonschema                     auto     /usr/bin/python3-jsonschema
jstack                         auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jstack
jstat                          auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jstat
jstatd                         auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/jstatd
keytool                        auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool
libblas.so.3-x86_64-linux-gnu  auto     /usr/lib/x86_64-linux-gnu/blas/libblas.so.3
liblapack.so.3-x86_64-linux-gnu auto     /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3
libpsm_infinipath.so.1         auto     /usr/lib/libpsm1/libpsm_infinipath.so.1.16
locate                         auto     /usr/bin/mlocate
lzma                           auto     /usr/bin/xz
mogrify                        auto     /usr/bin/mogrify-im6.q16
mogrify-im6                    auto     /usr/bin/mogrify-im6.q16
montage                        auto     /usr/bin/montage-im6.q16
montage-im6                    auto     /usr/bin/montage-im6.q16
mpi                            auto     /usr/lib/x86_64-linux-gnu/openmpi/include
mpirun                         auto     /usr/bin/mpirun.openmpi
mt                             auto     /bin/mt-gnu
nc                             auto     /bin/nc.openbsd
newt-palette                   auto     /etc/newt/palette.ubuntu
orbd                           auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/orbd
pack200                        auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200
pager                          auto     /bin/less
pbr                            auto     /usr/bin/python2-pbr
pico                           auto     /bin/nano
pinentry                       auto     /usr/bin/pinentry-gnome3
pinentry-x11                   auto     /usr/bin/pinentry-gnome3
policytool                     auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/policytool
pybabel                        auto     /usr/bin/pybabel-python2
rcp                            auto     /usr/bin/scp
rlogin                         auto     /usr/bin/slogin
rmic                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/rmic
rmid                           auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid
rmiregistry                    auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/rmiregistry
rmt                            auto     /usr/sbin/rmt-tar
rsh                            auto     /usr/bin/ssh
rst2html                       auto     /usr/share/docutils/scripts/python2/rst2html
rst2html4                      auto     /usr/share/docutils/scripts/python2/rst2html4
rst2html5                      auto     /usr/share/docutils/scripts/python2/rst2html5
rst2latex                      auto     /usr/share/docutils/scripts/python2/rst2latex
rst2man                        auto     /usr/share/docutils/scripts/python2/rst2man
rst2odt                        auto     /usr/share/docutils/scripts/python2/rst2odt
rst2odt_prepstyles             auto     /usr/share/docutils/scripts/python2/rst2odt_prepstyles
rst2pseudoxml                  auto     /usr/share/docutils/scripts/python2/rst2pseudoxml
rst2s5                         auto     /usr/share/docutils/scripts/python2/rst2s5
rst2xetex                      auto     /usr/share/docutils/scripts/python2/rst2xetex
rst2xml                        auto     /usr/share/docutils/scripts/python2/rst2xml
rst-buildhtml                  auto     /usr/share/docutils/scripts/python2/rst-buildhtml
rstpep2html                    auto     /usr/share/docutils/scripts/python2/rstpep2html
rview                          auto     /usr/bin/vim.basic
rvim                           auto     /usr/bin/vim.basic
serialver                      auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/serialver
servertool                     auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/servertool
start-here.svg                 auto     /usr/share/icons/gnome/scalable/places/debian-swirl.svg
stream                         auto     /usr/bin/stream-im6.q16
stream-im6                     auto     /usr/bin/stream-im6.q16
telnet                         auto     /usr/bin/telnet.netkit
text.plymouth                  auto     /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth
tnameserv                      auto     /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/tnameserv
traceroute6                    auto     /usr/bin/traceroute6.iputils
unpack200                      auto     /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200
unrar                          auto     /usr/bin/unrar-nonfree
vi                             auto     /usr/bin/vim.basic
view                           auto     /usr/bin/vim.basic
vim                            auto     /usr/bin/vim.basic
vimdiff                        auto     /usr/bin/vim.basic
vtrgb                          auto     /etc/console-setup/vtrgb
w                              auto     /usr/bin/w.procps
write                          auto     /usr/bin/bsd-write
x-cursor-theme                 auto     /usr/share/icons/DMZ-White/cursor.theme
x-session-manager              auto     /usr/bin/gnome-session
x-terminal-emulator            auto     /usr/bin/gnome-terminal.wrapper
x-window-manager               auto     /usr/bin/mutter
x-www-browser                  auto     /usr/bin/firefox

You can also see that cc is now using the correct gcc version from cc-v below

ferdy@palmiro:~$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

Looks clean. Please try to dpkg-reconfigure gcc-7.5 and purge/reinstall the generic kernel headers for the running kernel.

Just ran

ferdy@palmiro:~$ sudo dpkg-reconfigure gcc-7
ferdy@palmiro:~$ sudo apt install --reinstall linux-headers-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
Need to get 2,492 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-headers-generic amd64 4.15.0.132.119 [2,492 B]
Fetched 2,492 B in 0s (0 B/s)
(Reading database ... 342293 files and directories currently installed.)
Preparing to unpack .../linux-headers-generic_4.15.0.132.119_amd64.deb ...
Unpacking linux-headers-generic (4.15.0.132.119) over (4.15.0.132.119) ...
Setting up linux-headers-generic (4.15.0.132.119) ...

and

ferdy@palmiro:~$ sudo apt install --reinstall nvidia-driver-460
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
Need to get 431 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 nvidia-driver-460 amd64 460.32.03-0ubuntu0.18.04.1 [431 kB]
Fetched 431 kB in 0s (10.6 MB/s)
(Reading database ... 342293 files and directories currently installed.)
Preparing to unpack .../nvidia-driver-460_460.32.03-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-driver-460 (460.32.03-0ubuntu0.18.04.1) over (460.32.03-0ubuntu0.18.04.1) ...
Setting up nvidia-driver-460 (460.32.03-0ubuntu0.18.04.1) ...
ferdy@palmiro:~$ sudo reboot

but the problem persists. I’m attaching the logfile

nvidia-bug-report.log.gz (163.1 KB)

Your current kernel is 5.4.0-62-generic but the headers for 4.15 was installed. the package should be named linux-headers-5.4.0-62-generic
Looking at the date of the dkms make.log, it seems the last attempt was yesterday. Please remove the stale file
/var/lib/dkms/nvidia/460.32.03/build/make.log
and post the output of
dkms status
then try to build the module using
sudo dkms install nvidia/460.32.03 --all
and again post the output of
dkms status
also, please check if a new make.log is availble in
/var/lib/dkms/nvidia/460.32.03/build/

1 Like

Thanks, that worked great!!! I ran the commands you suggested, but without the --all in dkms, then rebooted. cheers!

It work for me too. Thanks a lot!!