Nvidia-smi "couldn´t communicate with driver" + NVIDIA probe routine failed for 1 device

I’m having troubles getting cuda working on a new laptop - I’ve tried a few versions of linux but with no luck. Latest is Ubuntu 22. I’m getting:

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.

It’s a fresh install, I’ve tried purging the nvidia drivers and re-installing the latest cuda. in the bios, it’s set to ‘legacy boot’

lspci  | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05)
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)

I’ll attach the bug report log, it has the lines:

Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068112] nvidia-nvlink: Nvlink Core is being initialized, major device number 508
Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068666] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:
Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068666] NVRM: BAR0 is 0M @ 0x0 (PCI:0000:01:00.0)
Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068677] NVRM: The NVIDIA probe routine failed for 1 device(s).
Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068678] NVRM: None of the NVIDIA devices were initialized.
Jul  9 11:11:28 nicholas-GF65-Thin-10UE kernel: [    2.068752] nvidia-nvlink: Unregistered Nvlink Core, major device number 508

any ideas on how to fix things?
nvidia-bug-report.log.gz (541.7 KB)

Hi there @nparslow5 !

What laptop model is this exactly? Not all laptops necessarily have Linux GPU support, sadly.

You might find a lot of suggestions on this particular problem in the dedicated Linux category here on the forums. For example this thread has a lot information, even if it is a bit older and with respect to Server setups.

In any case thiese lines are the key here:

Jul 9 11:11:28 nicholas-GF65-Thin-10UE kernel: [ 2.068666] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:
Jul 9 11:11:28 nicholas-GF65-Thin-10UE kernel: [ 2.068666] NVRM: BAR0 is 0M @ 0x0 (PCI:0000:01:00.0)

You should look in your BIOS for an option like “above 4G decoding” or “large/64bit BARs” and enable it. Very likely you will need to change to EFI mode instead of legacy.

It is recommended nowadays to go with UEFI boot and use the certified drivers offered by Ubuntu itself, going through the default authorization process to allow secure boot.

I hope this helps!

Thanks!