Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow boot time with Nvidia Drivers #1780

Closed
SPAstef opened this issue Feb 24, 2020 · 5 comments
Closed

Slow boot time with Nvidia Drivers #1780

SPAstef opened this issue Feb 24, 2020 · 5 comments

Comments

@SPAstef
Copy link

SPAstef commented Feb 24, 2020

Hi, I have a Optimus laptop with Nvidia drivers. When I start the PC without them, it usually takes just a couple seconds to boot, but when I enable them, it takes about 3 minutes. Now, having tried some things, I noticed that this tends to happen only after the 2nd reboot after the installation. I don't know how to gather more logs about this, but I've got "good" knowledge of Linux so if you tell me how, I can give you all the necessary extra informations. This issue persists basically since... I would say September 2019

@thiagomacieira
Copy link

thiagomacieira commented Feb 24, 2020

You can try to get information using systemd-analyze:

# systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @3.334s
└─multi-user.target @3.334s
  └─machines.target @3.334s
    └─systemd-nspawn@tjmaciei-ctnr.service @2.941s +392ms
      └─network.target @2.939s
        └─systemd-resolved.service @2.733s +205ms
          └─systemd-tmpfiles-setup.service @2.716s +16ms
            └─local-fs.target @2.715s
              └─var-lib-machines-dovecot.mount @2.711s +3ms
                └─var-lib-machines.mount @2.624s +85ms
                  └─dev-mapper-vg0\x2dstuff.device @2.623s
# systemd-analyze blame
2.213s systemd-cryptsetup@cr_sda4.service  
1.225s setup-proxy.service                 
 392ms systemd-nspawn@tjmaciei-ctnr.service
 381ms systemd-nspawn@dovecot.service      
 371ms systemd-logind.service              
 313ms swupd-update.service                
 206ms systemd-udevd.service               
 205ms systemd-resolved.service            
 203ms systemd-networkd.service            
 200ms fstrim.service                      
 191ms systemd-machined.service            
 184ms systemd-journald.service            
[...]

@SPAstef
Copy link
Author

SPAstef commented Feb 25, 2020

Ok, I'm attaching 2 files. First one, is the result of systemd-analyze time, the second one is what I actually see by using a chronometer. It's interesting to note that there are 2 "laps" I marked: during boot, I can see the caret blinking and some info appearing on the top left. After the caret stops blinking (first lap, ~15 sec. mark, roughly the same time reported by systemd...), I am able to access tty with CTRL+F2, BUT the graphical environment is still completely black (just like it is frozen, crashed or is somehow trying to fallback to another engine, just some guesses) for other ~1:40 minutes (second lap).

stefano@MSICL~ $ systemd-analyze
Startup finished in 15.739s (firmware) + 173ms (loader) + 705ms (kernel) + 1.444s (userspace) = 18.063s 
graphical.target reached after 1.384s in userspace
stefano@MSICL~ $

Capture+_2020-02-25-11-41-43

@ahkok
Copy link
Contributor

ahkok commented Feb 25, 2020

please post the output of systemd-analyze blame output. the time isn't very useful, it has no resolution.

Unfortunately a real life stopwatch is useless info. Sorry. A video would be a better source of information.

@SPAstef
Copy link
Author

SPAstef commented Feb 25, 2020

Ok, I have been able to solve this problem, and I think the solution might be of interest to all others with an Optimus laptop, since I've not seen this in any Clear Linux thread/issue:
by default, GDM tries to load up with Wayland. This will cause it to fail miserably and crash, causing a really long freeze/restart I guess (it probably tries a few times before giving up, IDK). In short, the solution is to create the file /etc/gdm/custom.conf, and appending the lines:

[daemon]
WaylandEnable=false

This has solved it after several reboots, and also seems to have stopped another issue I had, which is being unable to shut down the computer without cutting the power off (my pc would just get stuck on a black screen instead of turning off). Thanks @ahkok for the tips, didn't know about that command 👍

@ahkok
Copy link
Contributor

ahkok commented Feb 26, 2020

Cool, - yes, I wonder if gdm shouldn't just default to X11 if it detects NVIDIA drivers...

Thanks for reporting back in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants