Changing GPU without restarting machine or run app on differeng GPU ?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Javoc
Level 1
Level 1
Posts: 35
Joined: Fri Mar 10, 2017 1:27 am

Changing GPU without restarting machine or run app on differeng GPU ?

Post by Javoc »

Hi.
Pc has two GPU - invidia and intel.
Install driver for nvidia - and Nvidia X server settings - but then i change gpu it programm always told that i must restart to apply changes.
How to do this without restarting ?
or maybe exists way to run applications under different gpu ?
sudo blyat
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: Changing GPU without restarting machine or run app on differeng GPU ?

Post by Cosmo. »

You might try bumblebee for your request. It allows to launch certain programs with the dedicated NVidia graphics, whereas the system runs with the Intel graphic. Without Bumblebee it is impossible to switch the graphics driver without logging out and in or - depending from your OS and OS version - rebooting.
Javoc
Level 1
Level 1
Posts: 35
Joined: Fri Mar 10, 2017 1:27 am

Re: Changing GPU without restarting machine or run app on differeng GPU ?

Post by Javoc »

i install bumblebee - applications now have menu item Run with Nvidia GPU - but nothing happent if click on it.
sudo blyat
User avatar
InkKnife
Level 5
Level 5
Posts: 726
Joined: Mon Apr 30, 2012 5:24 pm

Re: Changing GPU without restarting machine or run app on differeng GPU ?

Post by InkKnife »

GPUs are simply not hot-swappable. Full stop.
i7 3770, 12GB of ram, 256GB SSD, 64GB SSD, 750GB HDD, 1TB HDD, Cinnamon.
SpookyWatcher
Level 3
Level 3
Posts: 183
Joined: Fri May 10, 2013 4:06 pm

Re: Changing GPU without restarting machine or run app on differeng GPU ?

Post by SpookyWatcher »

Javoc wrote:i install bumblebee - applications now have menu item Run with Nvidia GPU - but nothing happent if click on it.
Launch nvidia-settings

In prime profile choose Intel.

Reboot

Code: Select all

sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic

sudo apt-get install virtualgl

sudo apt-get install virtualgl-libs-ia32

sudo apt-get install primus

sudo apt-get install primus-libs-ia32
If your running 18.1 vitualgl won't install. No big deal.

I just solved every single one of my issues and thought I would pass everything along to anyone who might find it and benefit from it.

I have an Acer V3-772G 17 inch laptop with intel integrated + GT750M nvidia running Linux Mint 17 KDE 64 bit and Nvidia 331-updates via Driver Manager

A list of my problems:
Screen Tearing and no vsync - as can be seen here https://www.youtube.com/watch?v=ceX18O9pvLs
Screen Tearing and no vsync in my steam games
Screen freeze due to touchpad causing screen freeze
battery life
getting bumblebee to work correctly
getting steam to work correctly with bumblebee

First issue was screen tearing in everything. This is caused when have dual graphics (intel integrated and nvidia) and using Driver Manager to use proprietary nvidia drivers and Prime. Second was I was still getting screen tearing using the integrated graphics and neauvau. The reason the dual graphics causes tearing is because:
https://devtalk.nvidia.com/default/topi ... -gt620-m-/
When prime is enabled, there is currently no synchronization between the source device producing the pixels and the sink device reading them. I.e., in a typical NVIDIA + Intel configuration, the Intel chip just scans out the shared buffer constantly, without regard to when the pixels are copied into it.

The README mentions this in Chapter 32, "Offloading Graphics Display with RandR 1.4":

Caveats

There is no synchronization between the images rendered by the NVIDIA GPU and the output device. This means that the output device can start reading the next frame of video while it is still being updated, producing a graphical artifact known as “tearing”. Tearing is currently expected due to limitations in the design of the X.Org X server.


However!!! Bumblebee will fix it because it runs two instances of X11 servers and implements buffering and syncing much much better. Albeit at a cost in performance. But in my case it was neglible. So I needed to switch to bumblebee to get vsync. That is later.

First Change to Intel instead of Nvidia Prime in Nvidia Settings (reboot was required for me) Now you'll be on your integrated graphics.

I was still getting tearing with the integrated graphics and neauvau. First to solve this. Goto:
System Settings >> Desktop Effects >> Advanced Tab >> Select Following Options:
Compositing Type = OpenGL3.1
Qt Graphics = Native
Tearing Prevention (vsync) = Full Screen Repaints

This will solve tearing on the integrated graphics card and everything will run smooth as butter. Goto the youtube video I linked earlier to confirm.

But now I need bumblebee and need to get all my other games to work with it.

First uninstall steam. I even had to remove my steam games from local content to get this to work.
Second lets get bumblebee and all the other stuff installed correctly.

Code: Select all

sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic

sudo apt-get install virtualgl

sudo apt-get install virtualgl-libs-ia32

sudo apt-get install primus

sudo apt-get install primus-libs-ia32

Now need to edit your bumblebee.conf to reflect your current nvidia drivers (mine was 331-updates because that is what I chose in driver manager way back when)

Code: Select all

sudo nano /etc/bumblebee/bumblebee.conf

Change line 22 "Driver=" to "Driver=nvidia"
Change line 55 "KernelDriver=nvidia-current" or whatever it says to "KernelDriver=nvidia-331-updates" or "=nvidia-331" or whatever your current nvidia driver is
Change line 58 to "LibraryPath=/usr/lib/nvidia-331-updates:/usr/lib32/nvidia-331-updates" or whatever your current nvidia driver is
Change line 61 to "XorgModulePath=/usr/lib/nvidia-331-updates/xorg,/usr/lib/xorg/modules" or whatever your current nvidia driver is

Reboot

Test bumblebee by

Code: Select all

optirun glxgears -info
Once verifying it works, right click the icon on the desktop you want to run with the nvidia card and click properties.

Under command insert "primusrun" before the stuff in the command line.
Post Reply

Return to “Newbie Questions”