You are not logged in.

#1 2016-01-07 21:14:42

LukeS
Member
Registered: 2014-01-15
Posts: 6

My nvidia-prime like setup

After spending a little bit of time looking at the nvidia-prime and ubuntu-drivers-common packages from ubuntu i got a pretty decent grasp at how they worked ( even without much knowledge of python or c ) and i tried to create a bash script that did something similar.

https://drive.google.com/open?id=0B_jUL … zBLSzV1SU0  (new link,  slightly different config)

There are two scripts.

prime.sh - Install/uninstall libgl (its a very ugly solution since mesa-libgl and nvidia-libgl conflict) and creates a file where the desired card state will be writen to be used by gpumanager.sh
gpumanager.sh - I call this script on gdm PostSession (will probably work on silimar events on other login managers or run it when you stop x), it sets up the appropriete configs, load/unloads the nvidia module and calls bbswitch to turn the card on/off.

The rest are is mostly my configuration files. Standard stuff taken from https://wiki.archlinux.org/index.php/NVIDIA_Optimus (you might have to change the xorg config file or some of the other scripts if you don't use gdm)

I also edited prime-indicator so there is a nice widget to quickly switch cards.

What doesn't work:
If i boot the computer and let the nvidia card load ( thats why i blacklist and use the udev rule i took from bumblebee ) i will be unable to rmmod nvidia and bbswitch will fail too, but if i boot with the intel switching back and forth works smoothly.

Last edited by LukeS (2016-07-26 15:25:01)

Offline

#2 2016-05-04 19:15:26

abrasmelin
Member
Registered: 2016-05-04
Posts: 7

Re: My nvidia-prime like setup

Hello LukeS can you please tell how to install your scripts steps by step. I am trying to configure a hybrid setup for my arch linux and there are lots of info in internet but yours seem good.

Thanks!

Offline

#3 2016-05-10 02:12:29

LukeS
Member
Registered: 2014-01-15
Posts: 6

Re: My nvidia-prime like setup

abrasmelin wrote:

Hello LukeS can you please tell how to install your scripts steps by step. I am trying to configure a hybrid setup for my arch linux and there are lots of info in internet but yours seem good.

Thanks!

To install it you basically need to copy the files to the right place, see install.sh for the locations that i chose for my setup(if you change you will have to change the script)

The prime.sh file only changes the system's libgl since arch doesn't have something like update-alternatives and nvidia-libgl and mesa-libgl are conflicting libraries, to make it work you need to execute the gpumanager.sh script. The way i use it is on the stop script of my login manager i call the gpumanager.sh script (for gdm the path is /etc/gdm/PostSession/Default, for sddm is  /usr/share/sddm/scripts/Xstop), im not sure what is the best way to set it up if you don't use a login manager(just run gpumanager.sh and then start x i believe would work).

Also the script assumes a lot of things about my setup, i have the correct packages installed and just switch between the libgl ones, and also my xorg.conf for when i use the nvidia card

Also be mindful of special configs for your DM, when i made the script i was using gdm, if you use something different you will have to make small changes.

Editing much later because its important and i had forgotten, change UnloadModule to :

		modprobe -r nvidia_uvm
		modprobe -r nvidia_drm
		modprobe -r nvidia_modeset
		modprobe -r nvidia

Last edited by LukeS (2016-05-11 20:05:20)

Offline

#4 2016-07-02 15:48:30

abrasmelin
Member
Registered: 2016-05-04
Posts: 7

Re: My nvidia-prime like setup

Luke i am going to test this today with a new clean arch linux install so i need to ask a question. Which packages do i need before running your setup? Should i install bumblebee with non free nvidia drivers + intel drivers? And how is the indicator working?

And last and most important is i am not using gdm. I am using KDE so i am using sddm. What should i change exactly and in which files?
Thanks!

Last edited by abrasmelin (2016-07-02 15:54:59)

Offline

#5 2016-07-26 15:22:39

LukeS
Member
Registered: 2014-01-15
Posts: 6

Re: My nvidia-prime like setup

abrasmelin wrote:

Luke i am going to test this today with a new clean arch linux install so i need to ask a question. Which packages do i need before running your setup? Should i install bumblebee with non free nvidia drivers + intel drivers? And how is the indicator working?

And last and most important is i am not using gdm. I am using KDE so i am using sddm. What should i change exactly and in which files?
Thanks!

Sorry for taking so long to answer.

Here's the updated link: https://drive.google.com/open?id=0B_jUL … zBLSzV1SU0

I don't have bumblebee installed, only bbswitch and the nvidia drivers...

I switched to SDDM as well, theres not much difference, just a different config, i think the install.sh file is updated to sddm so you shouldn't have any problems with that, or you can look at the configs in the wiki, it's all default stuff.

I remade the indicator in QT(the primeindicatorqt file), everything is very ghetto but it works i guess...

EDIT: You will have to add the path to gpumanager.sh in the Xstop script(sddm) because i forgot to add that to the install script, i only realized this now.

Last edited by LukeS (2016-08-04 13:29:02)

Offline

#6 2016-08-02 17:28:35

Covington
Member
Registered: 2015-11-29
Posts: 1

Re: My nvidia-prime like setup

Thank you! Works perfectly.

Offline

#7 2016-08-26 19:37:40

emanuelx
Member
From: Portugal
Registered: 2012-11-06
Posts: 30

Re: My nvidia-prime like setup

Hi, in my notebook, i have some bugs in Intel Tearing.

I fixed a bug in position context menu, now is fixed!

And made some modifications for fix tearing in intel card!

Icons are now in /usr/pixmaps/ like original prime-indicator app.

https://github.com/emanuellopes/archLinuxPrime

Now is perfect in my system, Arch Linux with Cinnamon.

Offline

Board footer

Powered by FluxBB