Unable to use NVIDIA GPU on ubuntu 20.04

My laptop has NVIDIA GP107GLM [Quadro P620] gpu along with Intel UHD graphics.

lspci -nnk | grep -iA2 vga

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 05)
	Subsystem: Lenovo Device 22a6
	Kernel driver in use: i915
	Kernel modules: i915
--
01:00.0 3D controller: NVIDIA Corporation GP107GLM [Quadro P620] (rev a1)
	Subsystem: Lenovo GP107GLM [Quadro P620]
	Kernel modules: nvidiafb, nouveau
04:00.0 PCI bridge: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 2C 2018] (rev 06)

The driver installed is: nvidia-driver-515

Ubuntu kernel in use is: 5.10.0-1033-oem

I am unable to use the nvidia gpu and on running nvidia-smi it throws the below 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.

even after running prime-select nvidia it seems like it is using the intel gpu

lshw -C display

  *-display UNCLAIMED       
       description: 3D controller
       product: GP107GLM [Quadro P620]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:ad000000-adffffff memory:80000000-8fffffff memory:90000000-91ffffff ioport:3000(size=128)
  *-display
       description: VGA compatible controller
       product: UHD Graphics
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 05
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 mode=3840x2160 visual=truecolor xres=3840 yres=2160
       resources: iomemory:600-5ff iomemory:400-3ff irq:150 memory:6040000000-6040ffffff memory:4000000000-400fffffff ioport:4000(size=64) memory:c0000-dffff

I have tried switching off secure boot, installing cuda drivers, downgrading the driver version to 470 etc. but nothing seems to be working.

Any help is appreciated

Please try reinstalling the kernel headers
sudo apt install linux-headers-$(uname -r)
then check
dkms status
if the drivers are installed.

1 Like

Hi, reinstalling the kernel headers followed by a reboot did the trick. nvidia-smi works now. Thank you for the quick resolution!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.