Problems installing headlesss nvidia-460 drivers on Ubuntu server 20.04

I have a K2200 on Ubuntu server 20.04 and trying to install drivers first with NVIDIA-Linux-x86_64-465.27.run with no success so i ran from ppa

sudo apt install --no-install-recommends nvidia-cuda-toolkit nvidia-headless-460 nvidia-utils-460 libnvidia-encode-460

and get these issues

(Reading database ... 149493 files and directories currently installed.)
Removing libnvidia-cfg1-450:amd64 (450.119.03-0ubuntu0.20.04.1) ...
Removing libnvidia-encode-450:amd64 (450.119.03-0ubuntu0.20.04.1) ...
Removing libnvidia-decode-450:amd64 (450.119.03-0ubuntu0.20.04.1) ...
dpkg: libnvidia-compute-450:amd64: dependency problems, but removing anyway as you requested:
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | lib
cuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-460:amd64 which provides libcuda1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-460:amd64 which provides libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda-10.1-1 is to be removed.
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | lib
cuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-460:amd64 which provides libcuda1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-460:amd64 which provides libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda-10.1-1 is to be removed.
 libnvidia-ml-dev depends on libnvidia-ml1 (>= 418.39) | libnvidia-tesla-440-ml1 (>= 418.39) | libnvidia-tesla-418-ml1 (>= 
418.39) | libnvidia-ml.so.1 (>= 418.39); however:
  Package libnvidia-ml1 is not installed.
  Package libnvidia-compute-460:amd64 which provides libnvidia-ml1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libnvidia-ml1 is to be removed.
  Package libnvidia-tesla-440-ml1 is not installed.
  Package libnvidia-tesla-418-ml1 is not installed.
  Package libnvidia-ml.so.1 is not installed.

Removing libnvidia-compute-450:amd64 (450.119.03-0ubuntu0.20.04.1) ...
Selecting previously unselected package libnvidia-compute-460:amd64.
(Reading database ... 149453 files and directories currently installed.)
Preparing to unpack .../00-libnvidia-compute-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libnvidia-compute-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package libnvidia-cfg1-460:amd64.
Preparing to unpack .../01-libnvidia-cfg1-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libnvidia-cfg1-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package libnvidia-decode-460:amd64.
Preparing to unpack .../02-libnvidia-decode-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libnvidia-decode-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package libnvidia-encode-460:amd64.
Preparing to unpack .../03-libnvidia-encode-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libnvidia-encode-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-compute-utils-460.
Preparing to unpack .../04-nvidia-compute-utils-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-compute-utils-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-kernel-source-460.
Preparing to unpack .../05-nvidia-kernel-source-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-kernel-source-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-kernel-common-460.
Preparing to unpack .../06-nvidia-kernel-common-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-kernel-common-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-dkms-460.
Preparing to unpack .../07-nvidia-dkms-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-dkms-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-headless-no-dkms-460.
Preparing to unpack .../08-nvidia-headless-no-dkms-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-headless-no-dkms-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-headless-460.
Preparing to unpack .../09-nvidia-headless-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-headless-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-utils-460.
Preparing to unpack .../10-nvidia-utils-460_460.73.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking nvidia-utils-460 (460.73.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package nvidia-cuda-dev.
Preparing to unpack .../11-nvidia-cuda-dev_10.1.243-3_amd64.deb ...
Unpacking nvidia-cuda-dev (10.1.243-3) ...
Selecting previously unselected package nvidia-profiler.
Preparing to unpack .../12-nvidia-profiler_10.1.243-3_amd64.deb ...
Unpacking nvidia-profiler (10.1.243-3) ...
Selecting previously unselected package nvidia-cuda-toolkit.
Preparing to unpack .../13-nvidia-cuda-toolkit_10.1.243-3_amd64.deb ...
Unpacking nvidia-cuda-toolkit (10.1.243-3) ...
Setting up nvidia-cuda-dev (10.1.243-3) ...
Setting up libnvidia-compute-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Setting up nvidia-kernel-common-460 (460.73.01-0ubuntu0.20.04.1) ...
update-initramfs: deferring update (trigger activated)
Setting up nvidia-profiler (10.1.243-3) ...
Setting up nvidia-cuda-toolkit (10.1.243-3) ...
Setting up libnvidia-cfg1-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Setting up nvidia-kernel-source-460 (460.73.01-0ubuntu0.20.04.1) ...
Setting up nvidia-utils-460 (460.73.01-0ubuntu0.20.04.1) ...
Setting up libnvidia-decode-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
Setting up nvidia-compute-utils-460 (460.73.01-0ubuntu0.20.04.1) ...
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
Adding system user `nvidia-persistenced' (UID 112) ...
Adding new group `nvidia-persistenced' (GID 117) ...
Adding new user `nvidia-persistenced' (UID 112) with group `nvidia-persistenced' ...
Not creating home directory `/nonexistent'.
Setting up nvidia-dkms-460 (460.73.01-0ubuntu0.20.04.1) ...
update-initramfs: deferring update (trigger activated)
Loading new nvidia-460.73.01 DKMS files...
Building for 5.4.0-72-generic
Building for architecture x86_64
Building initial module for 5.4.0-72-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-460.0.crash'
Error! Bad return status for module build on kernel: 5.4.0-72-generic (x86_64)
Consult /var/lib/dkms/nvidia/460.73.01/build/make.log for more information.
dpkg: error processing package nvidia-dkms-460 (--configure):
 installed nvidia-dkms-460 package post-installation script subprocess returned error exit status 10
Setting up nvidia-headless-no-dkms-460 (460.73.01-0ubuntu0.20.04.1) ...
Setting up libnvidia-encode-460:amd64 (460.73.01-0ubuntu0.20.04.1) ...
dpkg: dependency problems prevent configuration of nvidia-headless-460:
 nvidia-headless-460 depends on nvidia-dkms-460; however:
  Package nvidia-dkms-460 is not configured yet.

dpkg: error processing package nvidia-headless-460 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing trigge
rs for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic
Errors were encountered while processing:
 nvidia-dkms-460
 nvidia-headless-460
E: Sub-process /usr/bin/dpkg returned an error code (1)

I removed it + reboot and tryed again with same issue
sudo apt update && sudo apt remove '^nvidia' && sudo apt autoremove

cat /proc/version
Linux version 5.4.0-72-generic (buildd@lcy01-amd64-019) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021

The kernel modules don’t compile. Wrong system compiler set? Please post the output of
gcc -v
cc -v

I ran sudo apt install gcc g++ and installed the packages again

nvidia.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-72-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-72-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-72-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-72-generic/updates/dkms/

depmod...

DKMS: install completed.
Setting up nvidia-headless-no-dkms-460 (460.73.01-0ubuntu0.20.04.1) ...
Setting up nvidia-headless-460 (460.73.01-0ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --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=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --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 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

cc -v

Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --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=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --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 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

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.

If you have another gpu in your system, please run
sudo prime-select on-demand
or
sudo prime-select nvidia
and reboot.
Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

Those commands are not found. nvidia-bug-report.log (180.5 KB)

The driver is loaded fine.

1 Like