I'm using Ubuntu 16.04 and after some time (I guess this started to happen after I updated Nvidia drivers) my computers began to boot very slowly. I tried to deactivate some unneeded services but it didn't help.
I ran dmesg
and I noticed some really large gaps. Here is the full log:
https://pastebin.com/d4EVfi8r
I hope someone will help me with this.
EDIT:
systemd-analyze blame | head
2min 16.363s docker.service
23.442s rabbitmq-server.service
16.774s grub-common.service
15.149s [email protected]
13.691s dev-sda1.device
11.113s NetworkManager-wait-online.service
9.852s ModemManager.service
9.278s accounts-daemon.service
8.372s iio-sensor-proxy.service
8.176s apparmor.service
lspci -k | grep -iEA3 '3D|VGA'
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Subsystem: Acer Incorporated [ALI] 3rd Gen Core processor Graphics Controller
Kernel driver in use: i915
Kernel modules: i915
--
01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
Subsystem: Acer Incorporated [ALI] GK208M [GeForce GT 740M]
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_375_drm, nvidia_375
EDIT2:
After disabling some services, this is what systemd-analyze blame | head
returns:
13.900s dev-sda1.device
12.040s NetworkManager-wait-online.service
10.572s ModemManager.service
9.424s accounts-daemon.service
8.030s apparmor.service
7.827s grub-common.service
7.356s systemd-logind.service
6.810s rsyslog.service
6.769s avahi-daemon.service
6.766s bluetooth.service
EDIT3:
Output of /var/log/boot.log
EDIT4:
From Grub to login screen it takes around 30 seconds, but from login screen until my computer is ready to use it takes around a minute.
There are three main ways (and probably a lot more than three ways total) to install nvidia drivers.
apt install
, my favorite way).run
formatyou'd think the files installed and the result would be the same but it's not.
Nvidia's very own
.run
file is pretty dubious if you ask me. I used to think it would be the most bleeding edge but it turns out it pales in comparison to the apt method in terms of performance. sure the driver version is the latest but perhaps it's windows-only code edits and of no particular benefit to how it runs on linux.I'd recommend uninstalling your current nvidia driver :
.run
in a sessionless console mode (ctl-alt-F6) then repeat the procedure and run the (admin) command as if you were going to install it but add the--uninstall
flag at the end of you install/sh command.you can install via the binary method in this way :
If your computer booted just fine before you installed the driver, your computer has more than 4GBs RAM, hard drive(s) and/or SSD(s) have plenty of space left and your computer only boots up slowly but works just fine after few seconds login screen appears, then the driver is most likely causing the problem.
I would suggest you to check out how high load your computer goes when you boot it and pay attention especially how much RAM, disk and / or SSD load there is during boots and also check if there are any updates available for the operating system and such.
Disabeling services you don't need is fine, but most likely won't really solve the issue (unless all disabled services use total of over 4GBs of RAM) because normally the ammount of RAM they use won't be much (Linux operating systems are MUCH lighter than Windows and you can easilly run 64 bit distros with as little as 1GB of RAM.)
Also check if your motherboards BIOS uses UEFI boot and if so, see if disableing it solves the issue.
UEFI boot isn't supported on Linux and your computer might just try to use UEFI boot because your Graphics card uses it automatically if UEFI boot is enabled before using the bootloader and hence the delay on booting.
Lastly you could try another Distro like Debian which is most stable distro of the family and ubuntu is based on.
There is always the simple but somewhat drastic option to not mix Ubuntu and Nvidia - i.e. if you can, remove the Nvidia hardware and use Intel graphics or anything else that is known to coexist nicely with Ubuntu. If you can't remove Nvidia (because perhaps the computer in question is a laptop), then the other option is replace Ubuntu by Windows. I know these are not great options, but they are simple and will definitely solve the problem. A quick scan in askubuntu and other sites would reveal a lot of people asking questions about Ubuntu/Nvidia, usually without a satisfactory resolution.