No GPUs detected by nvidia-xconfig, nvidia-smi not working

To begin, I have the following problem:

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.

I have had this problem before, recently, and it was easily fixed by sudo nvidia-xconfig followed by a reboot. Now, however, this command outputs ERROR: Unable to find any GPUs in the system..

How can I get nvidia to detect my GPU again?

Backstory/context:
This started with me trying to achieve 4K resolution on my monitor (which always results in a black screen, despite the setting being visible in xrandr). I asked about it in this thread.

I thought it might be a good idea to do sudo prime-select nvidia to see if I could get a full screen by forcing nvidia to be active. Upon rebooting, however, my system did not boot with a GUI at all. I had to access my user through a terminal with ctrl+alt+f2, where xrandr and xmodmap both gave me errors saying they could not find a display. I also got the error message Can't change power state from D3cold to D0 (config space inaccessible). It would occasionally work to boot into the GUI if I set the prime-select to intel, but then xrandr could only detect my laptop screen under a single resolution setting.

I purged the nvidia drivers and reinstalled the recommended driver for my system, nvidia-515, but still it didn’t work.

Eventually I followed the advice given in another post here, and blacklisted the nvidia driver in bumblebee’s config file. Only then the system would boot into the GUI again under the same resolution settings as I had before, and under the on-demand setting for prime-select. I do not think this is the reason for nvidia-smi and nvidia-xconfig no longer working, though, as they gave the same errors when I could only boot into the terminal, and supposedly bumblebee starts the nvidia-driver after booting anyway?

I would be really grateful if anyone would be able to help me get nvidia to find my GPU again, and even more still if the solution contains a hint for understanding why I am not getting the full resolution setting.
All help appreciated.

By the way, here is my nvidia bug report:
nvidia-bug-report.log.gz (246.3 KB)

Others and I have a similar issue. Considering the expert in these forums isn’t sure what is causing the problem, I don’t think it’ll get fixed any time soon.

You have bumblebee and bbswitch installed, bbswitch turns off the gpu. Please uninstall both. bumblebee and prime-select are mutual exclusives.

…and don’t use nvidia-xconfig, you have a hybrid graphics notebook, you mustn’t have an xorg.conf.

Ok, thank you. I have purged them both, and removed the xorg files. After a reboot I am still getting the same output from nvidia-smi, though.

  • run
sudo prime-select nvidia
  • run
grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*

to find a file containing

blacklist nvidia

and remove it,
then run

sudo update-initramfs -u

and reboot. If the problem persists, please create a new nvidia-bug-report.log.

Hey that worked! I have access to the GPU again.

I will set it back to on-demand, though, since the computer then runs more quietly.

The full resolution still does not work, but xrandr has switched the name of every output, adding a 1 to them. So what was DP-3 is now DP-1-3, eDP-1 is now eDP-1-1, etc. I guess this just means they all go through the GPU now?

In any case, thank you very much!

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