Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here it goes,

I have a laptop with an Nvidia GT520M card and I am running ubuntu 11.10. When I first installed ubuntu on my pc, I was able to use gnome3 and all was well (I suppose my laptop was using the intel card instead of the Nvidia one).

Because I wanted to develop some things in CUDA from my own machine, I started to look around on what I could do, so that I could use the discrete card just for CUDA and leave the other one to handle gnome. By installing nvidia's current drivers and bumblebee, I am now able to run programs in CUDA using optirun but my machine uses the simple version of gnome, without any effects whatsoever. Of course, when I removed nvidia's drivers, optirun couldn't run CUDA programs and stopped with :

[ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load module "nouveau" (module does not exist, 0)

Is there something I can do so that I can have both worlds?

share|improve this question
Nice question, but there has been a lot of struggling recently with intel video cards. – RobotHumans Mar 18 '12 at 5:48
Just a quick look at "Related" confirms that. I will keep on trying to figure something out and hopefully something good will happen. – Konstantinos Mar 18 '12 at 5:57
ha! I was searching for other posts on this problem and it seems that mine is the only post. :( – Konstantinos Mar 29 '12 at 17:45
up vote 1 down vote accepted

Getting both cards to work is highly problematic as stated in this question with 4000 views. One of the answers to that question references this one which has a bounty attached and over 26000 views.

So I do believe your question is mostly answered as "No, there is no documented way for this to work well at this point." in the previous questions.

share|improve this answer
Thanks aking. I did read both posts before writing my question here but I hoped for something new on this. – Konstantinos Mar 30 '12 at 21:17
I wish it were another way. It's a creative way to get around needing a desktop. It just isn't any other way. – RobotHumans Mar 31 '12 at 0:07
I think I did it! Ubuntu 12.04, downloaded the cuda toolkit for the previous version and the SDK, along with bumblebee and now it seems that everything is working. – Konstantinos May 19 '12 at 23:45
Neat. I suspect with the bumblebee solution that you're switching from one to the other in order to get CUDA working, but if you have something to add, I would definitely suggest posting your how-to here and on the other questions. – RobotHumans May 20 '12 at 0:02
Will do! Thanks! – Konstantinos May 20 '12 at 20:08

OK. So, just to make it plain for everyone who might be interested. My system is an optimus laptop with an NVidia 520M card. What I wanted to do was to have both a moderate hardware acceleration for gnome and to be able to run CUDA.

Here's what I did.

  1. After a fresh install of ubuntu 12.04, I downloaded from here the 32bit version of the toolkit and the SDK but not the drivers (last time that I tried to do something with them, I got either a corrupted X or a not so functional desktop).

  2. Then I installed bumblebee, so that I could run my programs on the discrete card.

  3. Installed the toolkit.

  4. Included the two lines to .bashrc

    export PATH=$PATH:/usr/local/cuda/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib
  5. Run sudo ldconfig

  6. And last but not least, logout and login.

Now you should be able to compile your programs with nvcc and run them via optirun.

Hope that helps. As you can see, it's actually pretty straightforward. I don't know why I didn't do it this way when I had an 11.10 system though.

share|improve this answer

By default it will probably be using both the CPU and Nvidia, in 13.10 and older.

However, as you can see here, better support for second video card (Optimus) is coming in 14.04.

Rather than tweak the current setup it may be better to try the beta/RC in a month or two.

share|improve this answer
It's been some time, got a new laptop and now everything works smoothly with 14.04. – Konstantinos Dec 5 '14 at 20:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.