I am Ubuntu 14.04 and have NVIDIA graphics card 820m running with driver v331.
On windows we can select which GPU to use to run a application. How can we do it on Ubuntu?
UPDATE:
my question was marked duplicate of this answer, which didnt helped
in Bumblebee Application Setting program, I set few application to be run on Performance Mode but it get reset to Unrecognized after I close the application (see image below)
Previously the Graphic in System Settings > Details used to be Nvidia but it is not Intel Haswell, which means nvidia is not being used :-/
COPY-PASTED FROM HERE
The current version of nvidia-prime uses one graphics card for the complete desktop. You either login with nvidia or intel.
I have had problems with bumblebee since 13.10. What works for me now is nvidia-prime. This allows you to choose which graphics driver you want to use in the nvidia control panel. This only works with lightdm (unity). I'm using this myself on Ubuntu 14.04
How to install
1. Use nvidia driver
Open the dash (super/windows key) and type in "drivers". Open "Aditional drivers" Select the nvidia binary (331.xx) driver.
Click "apply changes". Wait for the driver to be downloaded and installed, and click close.
2. Remove bumblebee and install prime
Open the shell by pressing ctrl-alt-t.
First let's make sure we have the latest software catalog.
Now remove everything bumblebee related.
Then install prime.
Now restart your computer.
How to use prime
After your computer has restarted, open the dash and type "nvidia". Open "Nvidia x-server settings".
Here you can choose between the intel and nvidia graphics driver. Choose the intel one for maximum power saving, choose the nvidia one for maximum performance.
After changing graphics card, you'll have to logout and log back in to apply the changes.
Difference between nvidia-prime and bumblebee
The current version of nvidia-prime uses one graphics card for the complete desktop. You either login with nvidia or intel. With bumblebee, you can start individual programs with a specific graphics card, like it is the case on windows.
Sadly, I can't get bumblebee to work on ubuntu 13.10 or higher...
If you want to select a specific GPU for the entire session, then selecting it with Prime, logging out and then logging back in will suffice.
However, if you really want to choose which GPU to use for each application, then you must use the
DRI_PRIME
environment variable for such specific application(s) instead of using the system-wide Prime setting.Ideally, it's recommended to use the Prime program in order to preset the integrated GPU (graphics processing unit) as the default (system-wide) one, i.e. it's recommended to set the integrated Intel graphics card as the default one, because it saves power, helps keeping your computer operating at a lower temperature et cetera. Then when you decide to run that very demanding 3D appplication, you use
DRI_PRIME
to tell the system that it must use your Nvidia GPU to run such specific application.As explained e.g. here and here, once you've used Prime to "tell" the system that your integrated Intel GPU is the default one to be used system-wide, you tell your Nvidia GPU to run the specific application by running the command:
...where
specific-application
is e.g. a 3D modelling application or a 3D game or any other program that requires a GPU with more powerful graphics processing capabilities. If e.g. you want your Nvidia GPU to process the graphics of the Inkscape application, just run:In order to run Blender using your Nvidia GPU instead of the integrated Intel GPU, just run:
Suppose that you want Blender to always use your Nvidia GPU instead of the integrated Intel GPU. In such case, you may use a text editor (such as GEdit, Nano, Mousepad, Leafpad etc.) in order to edit Blender's
.desktop
file:...and then replace this:
...with this:
...then just save the file, exit the text editor and start Blender by clicking on its icon at the Applications menu. Each one of those application icons at the Applications menu are one
.desktop
file, so if you modify e.g.blender.desktop
you're pretty much modifying the Blender application shortcut at your Applications menu so when you click on such shortcut it runs Blender withDRI_PRIME
set as1
(i.e. use the Nvidia GPU to run Blender).In case you don't know which is the current default GPU, run this command:
And in order to see which GPU is activated when you set
DRI_PRIME=1
, run this command:If your integrated Intel GPU is already set as the default (system-wide) GPU, then the first command (
glxinfo | grep "OpenGL renderer"
) will inform you that Intel is the GPU ran byglxinfo
by default, and the second command (DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
) will inform you that Nvidia is the GPU ran byDRI_PRIME=1 glxinfo
(i.e. Nvidia is not the default / system-wide GPU, butDRI_PRIME=1
successfully set Nvidia as the active GPU for that specific process initiated byDRI_PRIME=1 glxinfo | grep "OpenGL renderer"
).After some trial and error I discovered that you need to append the following two lines to the .desktop file of the app you want to use the dgpu by default.
It will then give you the option to launch using the integrated gpu instead of the discrete one. For the command linen run the following command, it will make a script called prime-run which you can call from the command line, for example opening gedit on the dgpu would be
prime-run gedit
.Here is the command.