Install Nvidia driver for CUDA to use "GPU" option in Blender (ubuntu (13.10-) 14.04)

31,229

Solution 1

Quick sum up of the issues and their fixes:

  • Optimus not supported by Ubuntu (13.10)

    -> Ubuntu 14.04 supports it out of the box!

  • Blender doesn't detect CUDA

    -> Use the proprietary driver (accessible in the additional driver panel)

  • Blender complains about CUDA 1.2. It only supports >=2.0

    -> Use Blender 2.96 or lower or install the CUDA toolkit

    -> AND use "Experimental" mode

=> It should work! :·)

For more informations: https://blender.stackexchange.com/questions/10800/cuda-acceleration-with-cuda-1-2

Thanks to everybody!

Solution 2

(Please see the update below)

For me, I had to:

So,

# Proprietary nvidia
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates

# PPA for Blender
sudo add-apt-repository ppa:thomas-schiex/blender

# Update..
sudo apt-get update

# Install
sudo apt-get install nvidia-current nvidia-modprobe blender

# Reboot

This was for Ubuntu 14.04, Blender 2.73, GeForce GTX 650 Ti.

Otherwise, using the ubuntu nvidia stuff, building blender from source, running blender from the downloaded tar ball, etc.. all failed.

UPDATE

This all seemed to work until I tried to render, but then I got

Failed loading render kernel, see console for errors

Then on the console:

 Cycles shader graph connect: can only connect closure to closure (image_texture.Color to output.Surface).
 Unsupported CUDA version 5.5 detected, you need CUDA 6.5.

Installing CUDA 6.5 involved completely installing nvidia-337 (otherwise you get a lot of cuda-6-5 : Depends: .... (=....) but it is not going to be installed. (as shown here) and instead installing nvidia-340.

To install this nvidia-340,

# nvidia PPA for v340
sudo add-apt-repository ppa:mamarley/nvidia

# Update
sudo apt-get update

# install nvidia and cuda
sudo apt-get install nvidia-340 cuda-6-5

# Reboot

Other sites (AskUbuntu on Lubuntu, R Tutorial, etc) recommend installing from the .run, but I had no issue just using apt-get. The process did archive (rename) my xorg.conf file which disabled my edit file, but that was simple to revert.

Solution 3

You can install nvidia-modprobe. The other way is to install Nvidia driver manually from Nvidia official site:

  1. Uninstall previous Nvidia drivers:

    sudo apt-get purge nvidia-
    
  2. Download latest version of your drever to your linux user folder, http://www.nvidia.ru/Download/Find.aspx

  3. Install dependences:

    sudo apt-get install linux-headers-`uname -r` binutils pkg-config build-essential xserver-xorg-dev
    
  4. Open blacklist:

    sudo nano /etc/modprobe.d/blacklist.conf
    
  5. Add the lines to blacklists:

    blacklist vga16fb
    blacklist nouveau
    blacklist rivafb
    blacklist nvidiafb
    blacklist rivatv
    
  6. Open xorg config file:

    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
    sudo nano /etc/X11/xorg.conf
    
  7. Add the lines to xorg config:

    Section "Screen"
        Identifier "Default Screen"
        DefaultDepth 24
    EndSection
    
    Section "Device"
        Identifier "Default Device"
        Driver "nvidia"
        Option "NoLogo" "True"
    EndSection
    
    Section "Module"
        Load "glx"
    EndSection
    
  8. Stop x-server:

    sudo service lightdm stop
    

    or

    sudo service gdm stop
    

    or

    sudo service kdm stop
    

    (depends on your linux version)

  9. Install the driver (be aware that only one copy of nvidia driver script there is in your user home directory):

    sudo sh ./NVIDIA*
    

Trough the installing process do not agree for any automated features. Only manual things work.

  1. Run x-server:

    sudo service lightdm start
    

    or

    sudo service gdm start
    

    or

    sudo service kdm start
    

    (depends on you linux version)

  2. Run Blender and you will see CUDA option appeared.

Share:
31,229

Related videos on Youtube

tuxtoriel
Author by

tuxtoriel

Updated on September 18, 2022

Comments

  • tuxtoriel
    tuxtoriel over 1 year

    Same question as on the Blender stackexchange site.

    As a recap:

    • I have to install the nvidia driver but how to do it? (repository or manually? And I already had problems with both, as said)
    • My computer detects an other graphic card as the one that I have! (Maybe the reason why no proprietary drivers are purposed)

    Every help is welcome!

    It came out that the problem was that I have OPTIMUS. But in 14.04 it seems to be supported.

    So, under 14.04 (on my external HDD) it detects my Nvidia driver OUT OF THE BOX!!! But with Blender and cuda installed as said on this site and this driver:

    enter image description here

    I then installed Blender from this ppa as well as the CUDA driver from the same site.

    Then, Blender detects the GPU!!!

    GPU detected

    But it says (Cycles mode with GPU rendering active):

    Cuda >= 2.0 only supported

    Even with Experimental on:

    enter image description here

    But on the site, thay say that Cuda < 2.0 is experimental:

    Cuda < 2.0 is experimental

    Should I wait, or could it help if I use another driver?

  • tuxtoriel
    tuxtoriel about 10 years
    Ok! I'll test it! I keep you informed!
  • tuxtoriel
    tuxtoriel about 10 years
    Ok, I tested it on an external HDD, with Ubuntu 13.10 installed on it. I installed Bumblebee and tested blender: nothing. Then, I installed the nvidia driver from ppa but nothing too! Should I wait for 14.04? (See this site)
  • tuxtoriel
    tuxtoriel about 10 years
    I installed 14.04 beta on my external HDD... And ubuntu detects my Nvidia graphics card OUT OF THE BOX!!! I used the additional drivers app to install the nvidia 331.38 version. Then I installed Blender with the irie ppa and CUDA like said on the same site. But then, Blender says:"CUDA device supported only with compute capability 2.0 or up, found 1.2". And in "Experimental" mode, it doesn't change anything too. Is it possible to change the version or something like this? Or should I wait the support (If I understand the Cycles wiki well)?
  • tuxtoriel
    tuxtoriel about 10 years
    For the Nvidia graphics card I choose 331.38 but can choose 304.117 too. Which is best? And should I install the "-updates" version instead of the normal one? (I added a screenshot in the question)
  • tuxtoriel
    tuxtoriel about 10 years
    I did install nvidia-cuda-toolkit (sorry, I only mentioned it in the comments below, in the response to Web-E). But it installs 1.2 ... (as I understood). I new it from this site. Do you think I could make something to make it work? (I'll update my question with the informations!) Thanks for your help!
  • C.Jacobs
    C.Jacobs about 10 years
    Sadly I have no other ideas. I'll look into it more and update my response if I find anything. This is an issue that plagued me so I know how frustrating this must be for you.
  • tuxtoriel
    tuxtoriel about 10 years
    It is very frustrating,yes! Thank you very much for your help! :) I'll update the post if I have some news!
  • tuxtoriel
    tuxtoriel almost 10 years
    That's exacly what I did recently, but it does NOT work with 2.70. BUT it WORKS with 2.96!!! :·). The only lasting problem is that, given that it doesn't install, I have to pass, at every launch, the load step (Blender loads something to let me use the graphics card). And my computer does not always pass it (overheating)! :( Thanks for the idea!