I’m trying to install nvidia drivers for my notebook Lenovo Legion7 on Ubuntu 18.04. My GPU is Hybrid Intel/ NVIDIA GeForce RTX3060 and the last driver is 470. So I tried different ways to install the driver via downloading the driver (.run) from official NVIDIA site, from Software&Update, installing from terminal. But when try:
nvidia-smi
Got the error:
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 think that the problem is that I have Hybrid GPU on my laptop. I run:
I think your kernel version is too old for that new notebook. Not even the integrated GPU is supported. Get a kernel v5.10 or higher.
I’d install Ubuntu 20. And then a newer kernel. If Ubuntu 20 is not an option, still go for a newer kernel.
Make sure you have the kernel headers installed. Then better use this ppa:
Never use the .run file!
If you don’t want to install Ubuntu 20, then run the .run file with the --uninstall option.
Then sudo apt purge nvidia* libnvidia*.
The steps below are also for Ubuntu 20, if you choose to install it.
Install a newer kernel und headers.
Then add the ppa and run sudo apt install nvidia-driver-470.
Then sudo prime-select nvidia and reboot.
If it’s not working, create a new bug report.
I want to remain on Ubuntu 18.04. I’ve tried to install severall types of kernels 5.14.7, 5.14.8 and 5.10. When I try to install kernel 5.10 there is the following error:
Selecting previously unselected package linux-headers-5.10.0-051000.
(Reading database ... 171407 files and directories currently installed.)
Preparing to unpack linux-headers-5.10.0-051000_5.10.0-051000.202012132330_all.deb ...
Unpacking linux-headers-5.10.0-051000 (5.10.0-051000.202012132330) ...
Selecting previously unselected package linux-headers-5.10.0-051000-generic.
Preparing to unpack linux-headers-5.10.0-051000-generic_5.10.0-051000.202012132330_amd64.deb ...
Unpacking linux-headers-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
Selecting previously unselected package linux-image-unsigned-5.10.0-051000-generic.
Preparing to unpack linux-image-unsigned-5.10.0-051000-generic_5.10.0-051000.202012132330_amd64.deb ...
Unpacking linux-image-unsigned-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
Selecting previously unselected package linux-modules-5.10.0-051000-generic.
Preparing to unpack linux-modules-5.10.0-051000-generic_5.10.0-051000.202012132330_amd64.deb ...
Unpacking linux-modules-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
Setting up linux-headers-5.10.0-051000 (5.10.0-051000.202012132330) ...
Setting up linux-headers-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
/etc/kernel/header_postinst.d/dkms:
* dkms: running auto installation service for kernel 5.10.0-051000-generic
Kernel preparation unnecessary for this kernel. Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching file Kbuild
Hunk #1 succeeded at 82 (offset 11 lines).
Building module:
cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j16 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.10.0-051000-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.10.0-051000-generic/build LD=/usr/bin/ld.bfd modules......
Signing module:
- /var/lib/dkms/nvidia-srv/470.57.02/5.10.0-051000-generic/x86_64/module/nvidia-modeset.ko
- /var/lib/dkms/nvidia-srv/470.57.02/5.10.0-051000-generic/x86_64/module/nvidia.ko
- /var/lib/dkms/nvidia-srv/470.57.02/5.10.0-051000-generic/x86_64/module/nvidia-peermem.ko
- /var/lib/dkms/nvidia-srv/470.57.02/5.10.0-051000-generic/x86_64/module/nvidia-uvm.ko
- /var/lib/dkms/nvidia-srv/470.57.02/5.10.0-051000-generic/x86_64/module/nvidia-drm.ko
Secure Boot not enabled on this system.
cleaning build area...
DKMS: build completed.
nvidia.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-051000-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.10.0-051000-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.10.0-051000-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.10.0-051000-generic/updates/dkms/
nvidia-peermem.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-051000-generic/updates/dkms/
depmod...
DKMS: install completed.
...done.
Setting up linux-modules-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
Setting up linux-image-unsigned-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.4.0-86-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-5.4.0-86-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-5.10.0-051000-generic
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-051000-generic
Processing triggers for linux-image-unsigned-5.10.0-051000-generic (5.10.0-051000.202012132330) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.10.0-051000-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-051000-generic
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-051000-generic
Found initrd image: /boot/initrd.img-5.10.0-051000-generic
Found linux image: /boot/vmlinuz-5.4.0-86-generic
Found initrd image: /boot/initrd.img-5.4.0-86-generic
Found linux image: /boot/vmlinuz-5.4.0-84-generic
Found initrd image: /boot/initrd.img-5.4.0-84-generic
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
When try to install the 5.14.7 or 5.14.8 there is the next error:
ERROR (dkms apport): kernel package linux-headers-5.14.7-051407-generic is not supported
So the kernels 5.14.7 or 5.14.8 are not supported. Is there some way to install 5.10 or I should switch to Ubuntu 20.04?
Thats first errors of the BIOS (check for an update).
Then your firmware files are too old. You could get the iwlwifi files from the url provided.
Still newer OS would help.
Re-reading your initial post… did you uninstall the files of the .run file installer using the --uninstall parameter?
If not do so, and then re-install the nvidia driver from ppa.
linux-firmware-xilinx-vcu/focal-updates,focal-updates 2020.2-0ubuntu1~20.04.1 all
linux-firmware/focal-updates,focal-updates,now 1.187.17 all [installed,automatic]
Bios version is H1CN33WW release date 07/18/2021.
Then stalled the drivers
There is no sign of the driver installation and/or it trying to load.
Do you have the kernel-headers package installed?
What’s the output of: dkms status?
I checked and when installed nvidia drivers I had some broken dependencies and ran:
apt --fix-broken install
and headears were deleted.
I’ve tried:
sudo apt install linux-headers-$(uname -r)
(I have kernel version 5.14.8-051408-generic) got:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers-5.14.8-051408-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linux-headers-5.14.8-051408-generic' has no installation candidate
Well you need the kernel headers in order to build the nvidia kernel modules.
Solve that and then run: sudo dkms autoinstall -m nvidia -v 470.74 -k $(uname -r)
I installed Ubuntu from USB (last time I upgraded it from Ubuntu 18.04) and now have the kernel version. 5.11.0-36-generic. Added the repository and and installed driver:
So to enter at the start I press Ctrl+Alt+F3 and selected intel
sudo prime-select intel
After that reboot. Tried nvidia-smi and got the same error that NVIDIA-SMI has failed ...
I’ve changed the prime-select to nvidia: sudo prime-select nvidia
and reboot. And it works!
Thank’s a lot for your patience. Finally it’s done!