'nvidia-smi' "No devices were found" on Ubuntu 22.04 RTX 4050 Mobile

I recently bought a new laptop with an RTX 4050, and the HDMI does not appear to work. In the “Software & Updates Additional Driver” menu, “nvidia-driver-530-open”. was the only option that did not boot to a black screen with a cursor in the top left corner. However, when I run nvidia-smi, it says “No devices were found”. I am hoping this has something to do with the HDMI not working.

I am a linux noob, so sorry if this is a dumb question, but does anyone have any ideas?

Hi there @giancarlo.zaniolo, welcome to the NVIDIA devloper forums.

First of all you should start by running the Laptop without an attached HDMI monitor and see if you can use the GPU in the first place. Do not install the “open” drivers from the third-party drivers if you are new to Linux (on a Laptop), it will be more complex to set up correctly.

If normal installation of GPU drivers works correctly with the internal screen, nvidia-smiwill work, unless the driver installation failed.
Then you can use the nvidia-settings to set PRIME to prioritize your NVIDIA GPU over the integrated Graphics. Only if that was successful should you try to add an external monitor.

So, start from scratch with internal screen only, use the proprietary non-open driver and follow the instructions exactly. If you have Secure boot enabled, you MUST sign the driver. Or disable secure boot.

I hope this gets you started!

Thanks for the advice! I should probably have mentioned this earlier, but part of my issues are because there seem to be many different ways to install drivers, and I am not sure which ones will produce the results I want. For example, when I run “sudo ubuntu-drivers install nvidia:530”, my computer will boot to a black screen with a cursor in the top left corner, forcing me to open a terminal with ctrl+alt+f3 and deleting the driver packages, while by installing a driver through the gui, it does not. Is there a best way to install the drivers? I am using Ubuntu 22.04 on a laptop with a 4050 and a Ryzen 7000 series processor. (https://www.microcenter.com/product/663008/asus-tuf-gaming-a17-fa707xu-ms94-173-laptop-computer-platinum-collection-mecha-gray)

1 Like

The recommended way nowadays for Ubuntu 20 or newer actually is to use the “Additional Drivers” Tab in the “Software & Updates” tool in the GUI. From there if you chose the proprietary NVIDIA driver and follow the instructions in detail, you should be fine.

Another safe option is to download the .run file from our Driver Download page and use that. To be on the safe side with this approach it is recommended to boot into console only mode, no GUI, before running that installer. That way there are no GPU drivers or kernel modules loaded. This helps avoid errors.

Installing using the “Additional Drivers” tab always causes it either to boot to no GUI or boot to GUI, but have nvidia-smi not work. I tried downloading and running the .run file, and while it did boot to Ubuntu GUI, nvidida-smi still did not work, saying “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. MAke sure that the latest NVIDIA driver is installed and running.”

That sounds weird.

With the .run file installation, could you run sudo nvidia-bug-report.sh and attach the result file here? Maybe that sheds some light on the situation. Usually a failing nvidia-smi points to an installation problem.

Also, are you able to run nvidia-settings? If so you can check if you can find PRIME Profiles in the X server settings. You can choose Performance Mode and see if that makes a difference, but i don’t think so.

When I run nvidia-settings, it says “NVIDIA driver is not loaded”, and that “nvidia-settings could not find the registry key file or the X server is not accessible.”. I can paste the whole error message if it is helpful.

nvidia-bug-report.log (935.2 KB)

If this is too much trouble, my computer is still within its return period, I may just swap it out for one without a graphics card. Would it be realistic to think that this can be figured out by next tuesday? In any case, thanks for all the help you have provided so far!

Firstly, I just wanted to thank you for reaching out to me to begin with. Due to circumstances, I will only be able to go to the computer store either in 3 hours, or the last possible day I can return the computer and still get store credit (next thursday). As I want to ensure I could get linux working on the new computer without issues, I will probably return the computer today, unless I could reasonably expect to have the graphics card working before the final return date.

Sorry it took me a bit longer to reply.

I suppose you already returned the laptop by now. Which is understandable. Correctly getting all features of the dedicated GPU supported in Linux on a Laptop is a bit more complex than on a Desktop device. And if you don’t NEED the GPU for your work, it makes things definitely easier.

In your specific case it was a driver installation mismatch. You had already installed a driver through Ubuntu Additional Drivers. Before trying a different method you MUST remove the old driver and reboot into console. Otherwise there will be issues.

1 Like

No worries at all! I did wind up returning the computer, so I cannot fully verify this would have fixed the issue, but thank you for the help!

1 Like

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