Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a MSI GT60 Laptop with an Optimus enabled GTX 670M GPU, and I have been trying to get CUDA going in Ubuntu 12.04 environment. I realize that Optimus is not supported in Linux, but I have read the following post suggesting that CUDA works for hybrid GPUs.

How can I get nVidia CUDA or OpenCL working on a laptop with nVidia discrete card/Intel Integrated Graphics?

I installed the NVIDIA driver via

    sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
    sudo apt-get update
    sudo apt-get install nvidia-current

The resulting driver version is 302.17, and supposedly GTX 670M is supported since 295.59. I also downloaded CUDA 4.2 from the NVIDIA site, and compiled it against nvidia-current libraries.

Unfortunately, when I run deviceQuery in the CUDA SDK, I get the following output

    cudaGetDeviceCount returned 38
    -> no CUDA-capable device is detected

Checking /proc/driver/nvidia/gpus/0/information gives the following

    Model:           GeForce GTX 670M
    IRQ:             16
    GPU UUID:        GPU-????????-????-????-????-????????????
    Video BIOS:      ??.??.??.??.??
    Bus Type:        PCI-E
    DMA Size:        32 bits
    DMA Mask:        0xffffffffff
    Bus Location:    0000:01.00.0

Here is the output of "lspci | grep VGA"

    00:02.0 VGA compatible controller: Intel Corporation Ivy Bridge Graphics Controller (rev 09)
    01:00.0 VGA compatible controller: NVIDIA Corporation Device 1213 (rev ff)

So... what am I doing wrong?

Thanks!

share|improve this question

2 Answers 2

OK I had the same problem. The following worked for me:

  • installing the NVIDIA developer drivers (295.41) without it overwriting the opengl files:

    sudo stop lightdm
    sudo ./devdriver_4.2_linx_64_295.41.run --no-opengl-files
    

    It's important not to tick the option to change the xorg.conf file

  • install the CUDA toolkit (4.2. for me since I need OpenCL) and the code samples as per usual

  • if you run deviceQuery as a super user it should work:

    sudo ./deviceQuery
    

It's all written in the doc file for the device drivers, in /usr/share/doc/NVIDIA_GLX-1.0/ (chapter 19).

share|improve this answer

I have exactly the same problem as you and although I don't know whether it will work for you, there is one solution. You can install the Bumblebee or Ironhide drivers to enable Optimus for Linux. Optimus uses your laptop to switch between the 2 video cards and so improve the performance of the battery.

share|improve this answer
    
I've read that bumblebee is not required for CUDA to work on Optimus GPUs, but tried it anyways. Installed bumblebee and bumblebee-nvidia packages, but ended up with the following error: [ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected. [ERROR]Aborting because fallback start is disabled. –  user1076693 Aug 1 '12 at 14:54

Your Answer

 
discard

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.