Problem description
On my laptop, I have a dualboot with windows 11 and ubuntu 20.04. On ubuntu, I’ve tried to plug in a second monitor through an HDMI cable, but there was no image showing on the second monitor.
First, my laptop was able to discover the monitor in Activities->Displays menu, but after trying to fix the issue I’ve actually made things worse, where the monitor wasn’t even shown.
After some searching I encountered there were some problems with my nvidia drivers (my graphics cards can be seen from the output of):
sudo lspci | grep 'VGA'
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c6)
Nvidia-smi not working
When i try:
nvidia-smi
The error message is:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
What I’ve tried to fix it
I’ve already tried many things to reinstall/update/configure my nvidia drivers, including:
Updating to latest version of nvidia-drivers:
The output of ubuntu-drivers devices
is:
== /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0 ==
modalias : pci:v000010DEd00002560sv000017AAsd00003A80bc03sc00i00
vendor : NVIDIA Corporation
driver : nvidia-driver-525-server - distro non-free
driver : nvidia-driver-525 - distro non-free
driver : nvidia-driver-535 - distro non-free
driver : nvidia-driver-535-server - distro non-free
driver : nvidia-driver-535-open - distro non-free
driver : nvidia-driver-470 - distro non-free
driver : nvidia-driver-525-open - distro non-free
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-535-server-open - distro non-free recommended
driver : xserver-xorg-video-nouveau - distro free builtin
So I’ve tried to install the correct drivers using:
$ sudo ubuntu-drivers autoinstall
$ sudo apt install nvidia-driver-535-server-open
(the recommended option)- Completely purging and reinstalling nvidia drivers using:
sudo apt-get purge nvidia-*
sudo apt-get update
sudo apt-get autoremove
And after that:
sudo apt install libnvidia-common-470
sudo apt install libnividia-gl-470
sudo apt install nvidia-driver-470
- Other attempts such as trying to remove a file in /etc/modprobe.d/ or /lib/modprobe.d/ that contains blacklist on nvidia
- Trying to disable secure boot following these commands:
sudo apt install nvidia-driver-470
sudo reboot
sudo apt install nvidia-cuda-toolkit
This actually shed light onto perhaps an even bigger problem - mokutil not working. After I’ve tried to get secure boot status using $ sudo mokutil –sb-state
, the process simply aborted.
Anyway, none of these attempts have worked.