'No devices were found' after installing cuda 11.02 on Ubuntu 20.04 for RTX3080

Can’t install Cuda and Nvidia driver successfully. I’ve tried at least 100 ways. This is the closest I’ve gotten.

Fresh Ubuntu 20.04 LTS install (erase eveything and reinstall) on my Asus TUF Dash F15 laptop with RTX 3080.

Downloaded cuda_11.2.2_460.32.03_linux.run
chmod +x ./cuda_11.2.2_460.32.03_linux.run
sudo sh cuda_11.2.2_460.32.02_linux.run

Got an error, checked /var/log/nvidia-installer.log
Log said to install gcc and make.
sudo apt install gcc
sudo apt install make
reboot

sudo sh cuda_11.2.2_460.32.02_linux.run
Says install is successful and make sure to include paths. I do that.
reboot

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

sudo nvidia-smi

No devices were found
grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*

/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb
/etc/modprobe.d/nvidia-installer-disable-nouveau.conf:# generated by nvidia-installer
/lib/modprobe.d/nvidia-installer-disable-nouveau.conf:# generated by nvidia-installer
/lib/modprobe.d/nvidia-runtimepm.conf:options nvidia "NVreg_DynamicPowerManagement=0x02"
ls /etc/modprobe.d

alsa-base.conf                  blacklist-modem.conf
amd64-microcode-blacklist.conf  blacklist-oss.conf
blacklist-ath_pci.conf          blacklist-rare-network.conf
blacklist.conf                  intel-microcode-blacklist.conf
blacklist-firewire.conf         iwlwifi.conf
blacklist-framebuffer.conf      nvidia-installer-disable-nouveau.conf
dmesg |grep -i NVRM
[    2.058581] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  460.32.03  Sun Dec 27 19:00:34 UTC 2020
[    4.362385] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[    4.362409] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[    4.503753] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[    4.503799] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[   25.317577] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[   25.317603] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[   25.459400] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[   25.459420] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[   36.598302] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[   36.598333] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[   36.740799] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[   36.740828] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[ 1181.836573] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[ 1181.836594] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
[ 1181.978424] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x30:0xffff:876)
[ 1181.978470] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0
lspci
0000:00:00.0 Host bridge: Intel Corporation Device 9a14 (rev 01)
0000:00:02.0 VGA compatible controller: Intel Corporation Device 9a49 (rev 01)
0000:00:04.0 Signal processing controller: Intel Corporation Device 9a03 (rev 01)
0000:00:06.0 PCI bridge: Intel Corporation Device 9a09 (rev 01)
0000:00:07.0 PCI bridge: Intel Corporation Device 9a23 (rev 01)
0000:00:08.0 System peripheral: Intel Corporation Device 9a11 (rev 01)
0000:00:0a.0 Signal processing controller: Intel Corporation Device 9a0d (rev 01)
0000:00:0d.0 USB controller: Intel Corporation Device 9a13 (rev 01)
0000:00:0d.2 USB controller: Intel Corporation Device 9a1b (rev 01)
0000:00:0e.0 RAID bus controller: Intel Corporation Volume Management Device NVMe RAID Controller
0000:00:14.0 USB controller: Intel Corporation Device a0ed (rev 20)
0000:00:14.2 RAM memory: Intel Corporation Device a0ef (rev 20)
0000:00:14.3 Network controller: Intel Corporation Device a0f0 (rev 20)
0000:00:15.0 Serial bus controller [0c80]: Intel Corporation Device a0e8 (rev 20)
0000:00:15.1 Serial bus controller [0c80]: Intel Corporation Device a0e9 (rev 20)
0000:00:16.0 Communication controller: Intel Corporation Device a0e0 (rev 20)
0000:00:1c.0 PCI bridge: Intel Corporation Device a0b8 (rev 20)
0000:00:1c.3 PCI bridge: Intel Corporation Device a0bb (rev 20)
0000:00:1d.0 System peripheral: Intel Corporation Device 09ab
0000:00:1f.0 ISA bridge: Intel Corporation Device a082 (rev 20)
0000:00:1f.3 Audio device: Intel Corporation Device a0c8 (rev 20)
0000:00:1f.4 SMBus: Intel Corporation Device a0a3 (rev 20)
0000:00:1f.5 Serial bus controller [0c80]: Intel Corporation Device a0a4 (rev 20)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation Device 2520 (rev a1)
0000:01:00.1 Audio device: NVIDIA Corporation Device 228e (rev a1)
0000:2e:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
10000:e0:1d.0 PCI bridge: Intel Corporation Device a0b0 (rev 20)
10000:e1:00.0 Non-Volatile memory controller: Silicon Motion, Inc. Device 2263 (rev 03)
modinfo nvidia
filename:       /lib/modules/5.8.0-63-generic/kernel/drivers/video/nvidia.ko
alias:          char-major-195-*
version:        460.32.03
supported:      external
license:        NVIDIA
srcversion:     1744B50B284E53E625E0B19
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        
retpoline:      Y
name:           nvidia
vermagic:       5.8.0-63-generic SMP mod_unload modversions 
parm:           NvSwitchRegDwords:NvSwitch regkey (charp)
parm:           NvSwitchBlacklist:NvSwitchBlacklist=uuid[,uuid...] (charp)
parm:           nv_cap_enable_devfs:Enable (1) or disable (0) nv-caps devfs support. Default: 1 (int)
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_EnableBacklightHandler:int
parm:           NVreg_RestrictProfilingToAdminUsers:int
parm:           NVreg_PreserveVideoMemoryAllocations:int
parm:           NVreg_EnableS0ixPowerManagement:int
parm:           NVreg_S0ixPowerManagementVideoMemoryThreshold:int
parm:           NVreg_DynamicPowerManagement:int
parm:           NVreg_DynamicPowerManagementVideoMemoryThreshold:int
parm:           NVreg_EnableUserNUMAManagement:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_KMallocHeapMaxSize:int
parm:           NVreg_VMallocHeapMaxSize:int
parm:           NVreg_IgnoreMMIOCheck:int
parm:           NVreg_NvLinkDisable:int
parm:           NVreg_EnablePCIERelaxedOrderingMode:int
parm:           NVreg_RegisterPCIDriver:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_GpuBlacklist:charp
parm:           NVreg_TemporaryFilePath:charp

lsmod |grep nvidia
nvidia_drm             57344  0
nvidia_modeset       1228800  1 nvidia_drm
nvidia              34041856  4 nvidia_modeset
drm_kms_helper        217088  2 nvidia_drm,i915
drm                   552960  8 drm_kms_helper,nvidia_drm,i915

lsmod |grep nouveau
//show empty  

What next?

Hi.
It is not recommended that you install the driver from the CUDA installer. First you try to uninstall that failed installation. I’m not sure, but I think you should run:

sudo sh cuda_11.2.2_460.32.02_linux.run --uninstall

Then without restarting the machine you add the following PPA and install the driver:

Instructions on how to add the PPA in section (Adding this PPA to your system)
Then you proceed to install nvidia driver, for example latest available:

sudo apt install nvidia-driver-470

Then you proceed to install CUDA toolkit (CUDA only)

sudo sh cuda_11.2.2_460.32.02_linux.run

Perhaps the installer will warn you at some point that you already have the driver installed. You ignore the warnings and continue. When the time comes when the installer gives a list of components to install, you only check the box for CUDA Toolkit, you don’t check the box for the driver. You see if you need samples, if not check nothing but only CUDA Toolkit. Proceed with the installation. When that is done, you open the following text file:

gedit ~/.bashrc

And add environment variables with the following lines at the end of the file:

# Nvidia CUDA
export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Save the changes and close the editor.
When you install another version of CUDA toolkit (11.4 for example ) you must modify the version there.

Reboot the machine and you check that CUDA is recognized from the terminal:

nvcc --version

**Documentation on these last steps here:

I did exactly as you said, kind person. I uninstalled according to https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwigjbKB6frxAhW5RzABHb_eDvcQFjABegQICBAD&url=https%3A%2F%2Fitectec.com%2Fubuntu%2Fubuntu-removing-nvidia-cuda-toolkit-and-installing-new-one%2F&usg=AOvVaw2KCxy2wiuiugFTGnbuAu1W

and followed your instructions exactly. nvcc --version returns

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

nvidia-smi

No devices were found

:[

This uninstall tutorial link seems to be old and mainly if you installed it from Ubuntu repositories, not from .run file. The command that I gave you from the terminal to uninstall the driver from .run file did not help? CUDA toolkit now appears to be correctly installed. What you have to try to clean is some failed installation of the nvidia driver from CUDA installer .run file.

Are you able to start nvidia settings from the application launcher?

You share the output of the following commands here:

cat /proc/driver/nvidia/version

and:

sudo lshw -c video

EDIT:
If the commands that I indicated you find that the nvidia driver is not being used/loaded, see if this helps to uninstall the driver installed from the .run file (you must do the step for the driver, not for the CUDA toolkit):

The uninstall command you gave didn’t work, it returned --uninstall command not found. So I ended up reinstalling ubuntu, erasing the disk, again to make sure all the corrupted nvidia driver stuff is deleted and followed your install instructions. Except, now it boots to a black screen with blinking cursor.

If I get to the terminal from there and run your commands, this is what I get (sorry if typo, manually typing since cannot copy/paste):

cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module 470.57.02 Tue Jul 13 16:14:05 UTC 2021
GCC version: 9.3.0 (Ubuntu 9.3.0-17ubuntu1"20.04)

and:

sudo lshw -c video

*-display
    VGA compatible controller
    product: Intel Corporation
    vendor: Intel Corporation
    physical id: 2
    bus info: pci@0000:00:02.0
    logical name: /dev/fb0
    version: 01
    width: 64 bits
    clock: 33Hz
    capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
    configuration: depth=32 driver=i915 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
    resources: iomemory:600-5ff iomemory:400-3ff irq:186 memory:6034000000-6034ffffff ioport:5000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40fffffff
*-display
    description: VGA compatible controller
    product: NVIDIA Corporation
    vendor: NVIDIA Corporation
    physical id: 0
    bus info: pci@0000:01:00.0
    version: a1
    width: 64 bits
    clock: 33mHz
    capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
    configuration: driver=nvidia latency=0
resouces: iomemory:600-5ff iomemory:600-5ff irq:16 memory:85000000-85ffffff memory:6020000000-602fffffff memory:6031fffff ioport:4000(size=128) memory:86000000-8607ffff

Meanwhile, nvcc --version returns

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

and nvidia-smi

No devices were found

Also, about the drivers in settings applications launcher, I had checked that before I did the os reinstall. It said manual driver was selected and wouldn’t let me click on anything else, or the revert button.

Oh, that’s a lot of work. A photo taken on the screen would have been enough.

If you install Ubuntu again from scratch, you don’t install anything from the .run file and you don’t install drivers from PPA either (for now).
Only you show here a screenshot of what “Software & Updates” → “Additional Drivers” tab looks like:

Regarding the data you show, the nvidia driver seemed to be well loaded. I don’t know if intel integrated GPU could be causing some incompatibility problem. Do you have the monitor/display connected to the motherboard of the PC? or is it connected to the nvidia card? You make sure the monitor/display cable is connected to the nvidia card.

I am committed to this laptop.

I re-installed Ubuntu using erase disk and re-install live-boot key. The “Additional Drivers” tab:

It is a ASUS TUF Dash F15 Laptop, so, I am not sure who is cabling who. I will reluctantly strip the laptop to figure out connections if it is the only way, but hopefully there is another?

Ok, this is a laptop. I’m not entirely sure how the nvidia Optimus/Prime laptop setup works, but I guess the driver should install correctly without doing any extra setup.

About “Additional Drivers” screenshot. Being connected to the internet, you choose the first option there to install nvidia-driver-470. Then click on “Apply Changes” button. You wait for it to download and install the drivers correctly.
Then you install the following package from the terminal:
sudo apt install nvidia-prime

When that is done you reboot the system. Then you show again the screenshot of “Additional Drivers” tab, and the output of:
cat /proc/driver/nvidia/version

If you cannot enter graphical mode after restarting (black screen with blinking cursor, etc), you try to enter from a terminal in rescue mode and uninstall the driver with:
sudo apt remove nvidia-driver-470

Did as you said, I selected 470 in the application launcher, then installed nvidia-prime, and a reboot.

Couldn’t get into graphical mode, so did the sudo apt remove nvidia-driver-470 as you suggested.

cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 470.57.02 Tue Jul 13 16:14:05 UTC 2021
GCC version: gcc version 9.3.0 (Ubuntu- 9.3.0-17ubuntu1~20.04)

Do you mean that you can now enter into graphical mode?
Could you update the system before trying to install the driver again?

sudo apt update

and:

sudo apt full-upgrade

When this completes successfully, you reboot the system and you try the 470 driver installation steps again from “Additional Drivers” tab.
This just in case an update fixed an existing kernel bug.

I mean it won’t boot properly. I get to a black screen and cursor.

Im running those update commands but on sudo apt full-upgrade I got waiting for cache lock: could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2836 (unattended-upgr)... 257s
and counting, since the seconds keep increasing. I’ll let it go for a while and report back.

UPDATE: So it finally finished the update. I rebooted the laptop, and still have a black screen and cursor.

The idea was that after removing the 470 nvidia driver from the terminal you could enter the system in graphical mode. Then in graphic mode update the system and restart it. And there try again the installation of 470 driver from “Additional Drivers”. Apparently you were never able to enter graphical mode after removing the 470 driver?

An alternative is for you to try a newer version of Ubuntu with newer versions of the kernel and other components, such as Ubuntu 21.04. Install it, and then update the system from internet. Reboot the system and then try to install the nvidia 470 driver from “Additional Drivers”. Reboot again.

If this doesn’t work either, you should open a new thread regarding how to install the nvidia driver on a laptop with an intel iGPU and nvidia card (with optimus technology I guess). trying to share the best possible specifications of your laptop.
For the moment, forget about CUDA. The most important thing is that you have a proprietary nvidia driver installed and correctly loaded first.

Correct. I rebooted after installing 470 driver, and since then I can no longer enter graphical mode.

I shall do this alternative method first and report back soon.

Apparently other users are also having problems with 470 driver on optimus laptop.

You try 460 drivers from “Additional Drivers” in any version of Ubuntu (“nvidia-driver-460” only, not the one labeled whith “server” word) .

1 Like

Thanks for all your help thusfar Yafu. However the issue is not resolved even with Ubuntu 21 or 460 driver, so I will open another ticket per your suggestion.

Hello again.
I’m not sure about laptop with optimus technology, but on my PC with intel iGPU, in BIOS I can select iGPU or PCIe (discrete card) as primary display or primary GPU. Can you find something similar in your BIOS? If you find it, select PCIe (nvidia discrete card) as the primary display or GPU.
If you are not interested in having windows installed in dual boot, you can disable Secure Boot from the BIOS. Then from the ubuntu installer USB stick when it shows you installation options, you choose the option that is NOT labeled as UEFI or EFI. Then you install Ubuntu, update the system and you reboot the system. You install nvidia 460 driver and “nvidia-prime” package as I had explained to you earlier. You just in case you run the following from the terminal:
sudo prime-select nvidia

Then you reboot the system.

The idea is that you have correctly installed the nvidia driver first. And once this is achieved, try to configure PRIME iGPU if necessary.

I am really angry to see that after so many years Nvidia still has not been able to make it easy for users to install drivers for Linux on optimus laptops.

Thanks for continued help! I posted new thread and was not succesful. They also suggested it is a secure boot problem.

There was no options like this. I had erase disk and clicked ‘advanced’ and could select using LVM or ZFS. I selected LVM?

Same results. After rebooting after driver install, I get stuck on Asus loading screen.

I am really hoping there is a solution since I paid a lot for this laptop to run nvidia driver stuff and I cannot return it since i swapped the os.

Also, I could not find anything similar, only 'DMVT Pre-Allocated" option in ‘graphics configuration’ in the bios.

So I created a live installer from Installation/MinimalCD - Community Help Wiki thinking it would avoid uefi.
Did all the installation instructions, booted and now I’m stuck on black screen with cursor but it says
hdaudio hadudioC0D2: Unable to bind the codec

Unable to bind the codec message looks like one I had on my old laptop. I had to remove the device to prevent suspend/resume problems. See this thread: Kernel 5.6: system freeze when resuming from suspend or hibernate - #21 by thesourcehim
Just make sure you remove right device (check with lspci) and update your initramfs after creating udev rule.

I did this. Issue persist. As soon as I install nvida-driver, stalls at boot. I’m trying various ways to set nvidia-gpu to default.