How to install nvidia driver for secondary GPU on laptop


#41

Luckily for you, I solved the screen corruption after resume issue a few days back. It literally took me months to figure out the solution using a systemd user service…

Create:

~/.config/systemd/user/plasma-restart.service

Systemd plasma-restart.service file contents:

#~/.config/systemd/user/plasma-restart.service
#systemctl --user enable plasma-restart.service
#systemctl --user start plasma-restart.service
#systemctl --user status plasma-restart.service
#systemctl --user stop plasma-restart.service
#sudo loginctl enable-linger <username>
#systemctl --user daemon-reload
#systemctl --user daemon-reexec 
[Unit]
Description=Restart plasmashell after resuming
After=suspend.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes 
ExecStart=/usr/bin/sudo -u $USER /bin/bash -lc 'kquitapp5 plasmashell'
ExecStop=/usr/bin/sudo -u $USER /bin/bash -lc 'plasmashell > /dev/null 2>&1 & disown; sleep 2; exit'

[Install]
WantedBy=sleep.target

Enable the plasma-restart.service:

systemctl --user enable  plasma-restart.service

Reboot.


#42

Well so far there is one problem that’s probably resulting from the optimus drivers, since I’ve never had this problem before - occasionally when I boot up my laptop, it won’t show my battery. I have the battery icon in the system tray, but when I hover over it it says “no batteries available”, and clicking it indeed doesn’t show a battery, however I do obviously have a battery that inxi -Fxxxz manages to detect.

EDIT: I should add now however, that after a while it does show a battery when I hover over the icon, but sometimes it still doesn’t show it when I click over the battery icon in the system tray

EDIT2: Other than that, I still haven’t used my laptop enough after making the switch to decide whether the battery is noticeably worse, however it kinda feels like my laptop’s faster, which is weird since normally my nvidia gpu isn’t necessary for non-game usage to feel snappy

EDIT3: Ok so after starting my laptop, it was at 86%, now however, 30 minutes later, it’s at 70% battery, and every time I look at it it’s dropped by several percent at once.

EDIT4: I was using my laptop in class and I literally had to restore my snapshop back to bumblebee’s, cause I was afraid at this rate my battery wouldn’t last another hour. Right before the restore process my battery was at 70%, now after booting into the old snapshop it’s 61%.


#43

a perfect example of how useful snapshots can be. aside from that though you should do some battery life benchmarking from a full charge , once on prime and again on intel. since you really need every little drop of battery life possible, you may benefit more from optimus manager (tutorial) .

if you decide to try it, restore the nvidia prime snapshot first so you wont have to deal with any of the bumblebee conflicts we spent some time figuring out, this would also be better since it would keep snapshots in order bumblebee>>prime>>optimus-manager. make sure you remove any/all files/configurations made during the prime tutorial first before anything else and then follow the optimus-manager tutorial very carefully. if you run into any issues you cant figure out, create a new thread since this one is solved.


#44

with nvidia-prime you can try this to avoid running nvidia gpu:

  • one xorg conf for intel/modesetting
  • another one for nvidia gpu
  • create a script that:
    for intel:
  • disable/blacklist nvidia modules (if they still get loaded when blacklisted disable them)
  • also blacklist nouveau modules if you have them installed (probably not)
  • symlink the correct config to /etc/X11/xorg.conf.d
    for nvidia:
    same as above just load the nvidia modules and symlink the correct xorg.conf

That seems to work for me, because if I check enabled value of nvidia gpu in sysfs it shows 0 if I’m not using nvidia and dont have nvidia modules loaded. If I’m using nvidia it shows 1. It also shows 1 if I use intel with loaded nvidia modules (for switching without reboot)


split this topic #45

19 posts were split to a new topic: Vetzki’s PRIME tutorial discussion