4

Good afternoon!

I’ve been trying to get the nvidia drivers to work on my Ubuntu 18.04 for quite some time. I have an Intel i5 8th gen with integrated graphics (intel 620 graphics), and a Nvidia GeForce 940MX, so I know that the right driver version for me is the nvidia-440. I’ve tried every solution posted on this site, and so far this is the one that worked best for me:

Trying to install nvidia driver for ubuntu Desktop 18.04 LTS

but now the PC freezes at the purple screen right after I type my login credentials.

I’ll illustrate what I did to explain why I think the problem now is a malfunction with the intel integrated graphics.

Following the advice, I run these lines

sudo apt purge nvidia-*
sudo apt install nvidia-kernel-source-440
sudo apt install nvidia-driver-440

Adding the nvidia-kernel-source install is an improvement with respect to other solutions, because now, if I run

lspci -k | grep -EA2 'VGA|3D

I get this output


00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
    Subsystem: ASUSTek Computer Inc. UHD Graphics 620
    Kernel modules: i915

01:00.0 VGA compatible controller: NVIDIA Corporation GM108M [GeForce GTX 940MX] (rev a2)
    Subsystem: ASUSTek Computer Inc. GM108M [GeForce GTX 940MX]
    Kernel driver in use: nvidia

This solution is nice because it doesn’t require me to blacklist nouveau manually, but takes care of it on it’s own. In fact, if I now look at my gpu-manager.log file, I get this output:

var/log/cat/gpu-manager.log
last boot file: var/lib/ubuntu-drivers-common/last-gfx-boot
new boot file: var/lib/ubuntu-drivers-common/last-gfx-boot
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for nvidia modules in /lib/modules/4.15.0-76-generic/updates/dkms
Found nvidia module: nvidia-drm.ko
Looking for amdgpu modules in /lib/modules/4.15.0-76-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is intel loaded? yes 
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no 
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro-stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is nvidia kernel module available? yes
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:5917
BusID "PCI:0@0:2:0"
Is boot vga? Yes
Error: can’t access/sys/bus/pci/devices/0000:00:02.0/driver
The device is not bound to any driver
Vendor/device Id: 10de:134d
BusID "PCI:1@0:0:0"
Is boot vga? no
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Skipping “/dev/dri/card0”, driven by “nvidia-drm”
Does it require offloading? no
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards?
Has the system changed? no
Intel IGP detected
Desktop system detection 
or laptop with open drivers
Nothing to do

As you can see, nouveau is already blacklisted, but there is a problem related to the BusID "PCI:0@0:2:0", which is indeed my Intel IGP.

Could help me figuring out how to solve it?

This thread illustrates a problem similar to mine, but no solution works in my case:

https://ubuntuforums.org/showthread.php?t=2396607

This other has a similar error code

lspci returns "Cannot open /sys/bus/pci/devices/xxxxx/resource: No such file or directory" but I don’t get the error when running lspci , so I’m kinda skeptic in trying, and risk compromising my system running the line

apt-get remove linux-image-4.4.0-75-generic

which in my case I guess should be modified to remove the version linux-image-4.15.0-76-generic, judging by the first lines in the output of gpu-manager.log

I’m basically searching for a solution that doesn’t require re me to edit the grub file with the “nomodeset” line, which compromises the display resolution, and in this case is not even useful to access to the full GUI interface. Even with this edit, I’m stuck at the black screen low-res terminal that is accessible via ctrl-alt-F2.

I could easily purge the nvidia drivers again, but I don’t want to renounce using the full potential of my hardware...

Thanks in advance for your time! :)

MaryLu
  • 51
  • In between trying to fix nvidia, if you want to use your desktop with good performance and resolution use sudo prime-select intel and your Intel GPU will be active. Then when you are ready to try new things with nvidia use sudo prime-select nvidia. I used my last laptop for year with sudo prime-select intel. It's only this newer laptop (2 years old) where nvidia has worked well for me. – WinEunuuchs2Unix Feb 02 '20 at 17:17
  • Thanks for the suggestion! By any chance, do you know if that works also with the nouveau drivers, or do you need the nvidia ones? Because with the nvidia drivers installed I can’t log in to the GUI environment. And can you maybe tell me how did you manage the nvidia drivers to work? My laptop is 2 years old, too, so I’m fairly confident is not a problem of outdated hardware. – MaryLu Feb 04 '20 at 10:59
  • I believe prime-select is a command that only works with nVidia drivers but have never used nouveau drivers. Another suggestion if you haven't tried it yet; after you boot you can use dmesg to look for error messages. – WinEunuuchs2Unix Feb 04 '20 at 12:40

2 Answers2

1

I found a solution to my own problem, even though I wasn't able to track down the cause of the issue with the Intel integrated graphics, which appeared to have been cleared on its own.

On my next boot (still without access to the desktop environment) I verified the contents of the gpu-manager.log file:

mary@mary:~$ cat /var/log/gpu-manager.log
log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for nvidia modules in /lib/modules/4.15.0-76-generic/updates/dkms
Found nvidia module: nvidia-drm.ko
Looking for amdgpu modules in /lib/modules/4.15.0-76-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is nvidia kernel module available? yes
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:5917
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:134d
BusID "PCI:1@0:0:0"
Is boot vga? no
Skipping "/dev/dri/card1", driven by "nvidia-drm"
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card1", driven by "nvidia-drm"
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card1", driven by "nvidia-drm"
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card1", driven by "nvidia-drm"
Found "/dev/dri/card0", driven by "i915"
output 0:
card0-eDP-1
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
Has the system changed? No
Intel IGP detected
Intel hybrid system
Creating /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
Setting power control to "on" in /sys/bus/pci/devices/0000:01:00.0/power/control

I hadn't run any other command on the terminal, so I'm not sure what did the trick with the regards to the Intel drivers.

Still, I was left without access to the desktop environment, and couldn't launch the nvidia-settings tool.

Following the advice on this thread

How do I install the Nvidia drivers?

from the paragraph "What common bugs are solved by using the latest drivers?", I verified that nvidia was creating its own Xorg file, but still reinstalling Xorg seems to solve the issue that was blocking me from the desktop environment. (If you attempt this make sure you have internet connection to re-download the Xorg package once you purge it...)

I run the lines:

sudo apt-get remove --purge xserver-xorg
sudo apt-get install xserver-xorg
sudo dpkg-reconfigure xserver-xorg

and then reinstalled the nvidia drivers with

sudo apt-get install --reinstall nvidia-drivers-440

On my next boot, I could succesfully log in to the desktop environment, and now my nvidia GeForce card is actually recognised by the system. I am also now able to launch nvidia-settings (without reinstalling it or anything), and switch between nvidia GPU and the Intel IGC.

With previous solutions, I also run into the issue of black screen after sleep. I can confirm that now this issue doesn't appear anymore.

MaryLu
  • 51
  • I will wait a bit before declaring this answer as the solution, to see if somebody can chime in to help shed light on the Intel IGC drivers. – MaryLu Feb 05 '20 at 13:05
0

Reinstalling xserver-xorg finally helped me solve the issue of freezing during the boot process. Thank you for that! Now I at least have access to the GUI again. Also: Nvidia and Ubuntu seem to not really work well at all. It feels like my GPU (GeForce GTX 950M) is not working properly and is outperformed by the integrated device. That is definitly not what I had in mind when I chose this graphics card.