As the title, how can I correctly setup nvidia-optimus technology on Ubuntu?
Ubuntu – How to install nVidia drivers with Bumblebee on Ubuntu 14.04
14.04bumblebeenvidianvidia-optimusnvidia-prime
14.04bumblebeenvidianvidia-optimusnvidia-prime
As the title, how can I correctly setup nvidia-optimus technology on Ubuntu?
Best Answer
NB: this post is the result of many days spent reading various stuffs on the web, so take it at your own risk. It was tested on Ubuntu 12.04/12.10/13.04/13.10/14.04 (all 64bit) with nVidia GT650M graphic card. Feel free to add comments and suggestions
Install nVidia and bumblebee
1. First of all, we have to delete all the video drivers on the computer:
Then bumblebee in case if you have installed it previously:
We have also to delete all the nouveau driver with:
To be sure to have deleted the whole stuffs, try to type
dpkg -l | grep nvidia
anddpkg -l | grep bumblebee
: it shouldn't return anything. Fordpkg -l | grep nouveau
it is likely that it returns some lines sayinglibdrm-nouveauXXXXX
; for now, just ignore them.2. Then, we have to assure to have all the headers typing:
3. The next thing to do is to blacklist the remaining nouveau drivers and some other packages that could cause problems:
Adding the following lines at the end of file:
Just save and exit.
4. Now, run the best knows ubuntu commands
5. From now, we works on tty. Open the tty1 console with CTRL+ALT+F1 and login with your username and password. Then execute:
Now we will install the drivers. Execute:
where XXX is the latest stable drivers. I'm using the 331 drivers, but I've read somewhere that the 343 are available to download (don't know if they are stable).
N.B: With the latest driver versions, it also install
nvidia-prime
by default. This technology is intended to automatically switch between Intel and nVidia graphic card without user intervention. To do this, it leaves both the cards turned on. Optimus, on the other hand, turn on the nVidia graphic card only with explicit user request; it translates in significantly less power consumption respect to prime.I personally prefer optimus over prime, but if you don't bother on the enormous waste of energy, stop here. Otherwise, you have two options:
completely delete prime (
sudo apt-get remove --purge nvidia-prime
);leave prime there; in section "Prime with optimus" we will see how to make optirun work also with prime installed
6. Now, we have to install bumblebee and the virtualgl packages with
Then, we have to add our user in the bumblebee group with:
And then reboot the pc.
7. Login on your user account, open a new terminal window and type:
Among the various listed files, there should be two in particular:
bumblebee.conf
andxorg.nvidia.conf
. Let's make a backup copy of both with:You should replace FILE_NAME with the actual name of the file. Then, let's go to modify the first file with
sudo gedit bumblebee.conf
, adding (all without quotes)Assure that the "XorgConfFile" under [nvidia-driver] is equal to "/etc/bumblebee/xorg.conf.nvidia" (again, without quotes), then save and close gedit.
Now we have to edit the other file with
sudo gedit xorg.conf.nvidia
(in this case we have to insert the quotes also!!). ReplaceOption "ConnectedMonitor" "DFP"
withOption "UseDisplayDevice" "none"
, save and exit.8. Run
gedit /etc/modprobe.d/bumblebee.conf
and make sure that all the lines containingblacklist <something>
are not commented (i.e. they don't start with#
).9. At this point, run the following command
If it returns an error, try to run again the command with restart rather than start. If you have still errors, something like:
It's probably something wrong in the bumblebee.conf file; so, recheck step 7.
If instead the result is similar to:
You're soon done setting up bumblebee!
10. Now we can simply run
optirun glxspheres
oroptirun glxspheres64
. If all work as expected, you have an output like this:To double-check that we are actually using nvidia-drivers, open another terminal while
optirun <application>
is running, then typesudo lshw -c display | grep driver
. The result should be something like that.If, on the other hand, you close all the application started with
optirun
it should show only the intel driver. That's it!!Install Bumblebee UI
Thanks to this answer from Pavak Paul, here is the instructions to add the bumblebee user interface on Ubuntu 14.04 to manage apps to be opened using nVidia.
1. Install Python App Indicator:
2. Install Git:
3. Make a directory for git:
4. Check out the repository:
5. Go to Startup Applications and add bumblebee-indicator [click on Add, then insert the Name and comment that you want; insert
bumblebee-indicator
in the command box and click on Add).6. Reboot.
Prime with optimus
If you want to have the option to also use
nvidia-prime
sometimes, try to follow the instructions below.1. To prevent
bumblebeed
from starting at boot-time, execute:2. This point is the most problematic; it prevents bumblebee to blacklist nVidia drivers and should result in graphic session freeze. Try it at your own risk! Run:
And comment the line containing your nVidia XXX drivers. It should result in something like that.
3. Reboot the system and launch
nvidia-settings
. The final situation is this:If you select "Intel (Power save)" in nvidia-settings, you have only the Intel graphic card turned on by default. You still have to run an application with
optirun
to use the nVidia graphic cardIf instead you want to use the "Nvidia (Performance)" profile, select it from nvidia-settings, then login/logout and all should work automatically. The only thing is that you don't have to launch
bumblebeed
daemon with this profile selected because it could cause troubles.In case you have problems:
1. If you want to use only
nvidia-prime
:Then reboot.
2. If you want to use only optimus without removing nvidia-prime, edit again the previous file:
Uncommenting (removing the # character) from the lines previously modified:
And rebooting. In this case, you can leave bumblebeed run at boot-time: