11

I'm trying to get CUDA (although not sure exactly what it is) to work in Ubuntu for GPU rendering in the Blender 3D modelling program. On Windows 7 64-bit, it works flawlessly. In Ubuntu, I can't enable the GPU processing features in Blender. I'm assuming Nvidia's CUDA needs to be installed.

Can this be done? If so, can I get the details on how to do it? Thanks!

Running Ubuntu GNOME 15.04 x64 w/ GNOME 3.14, Nvidia GTX 660 and Nvidia proprietary drivers.

3 Answers 3

13

To install CUDA from the standard repositories do a:

sudo apt-get install nvidia-cuda-toolkit nvidia-modprobe

This will currently install V6.5 of CUDA. At the time of this writing V7.0 is the latest and can be had straight from the nVidia repositories. Read this warning before you head to the nVidia repositories.

2
  • 1
    Thanks for the suggestion. I did try to install that package by itself and see if that would fix it. However, it didn't enable the CUDA/GPU rendering capabilities in Blender, unfortunately.
    – Rebel
    Jul 31, 2015 at 19:48
  • 1
    I edited your post to include the package "nvidia-modprobe" in the command. YES, it works! It needed nvidia-modprobe for Blender to read the GPU's. Thanks for the help!
    – Rebel
    Aug 18, 2015 at 6:34
4

I was able to find a solution on Nvidia's website. They have a .deb package that you have to download and install on your system to enable the repository to install CUDA from Nvidia directly. Here's how I got it working:

  1. Go to https://developer.nvidia.com/cuda-downloads
  2. Choose the .deb file that corresponds to your Ubuntu version. (At the time, they didn't have a package for Ubuntu 15.04, so I chose the one for 14.10 instead. This did solve my problem, but I'm not sure if it will create any compatibility issues down the road. Doesn't seem like a terrible risk, but I wanted to make that known.)
  3. Go to your file browser, located the downloaded .deb package, and double-click (or single-click) to install the package via Ubuntu Software Center.
  4. Open a terminal
  5. Type: sudo apt-get update
  6. Type: sudo apt-get install cuda
  7. Wait for the packages to download and install, then restart your computer (the packages were over 900MB for me, so it took around 20 minutes to download with my connection)

After the reboot, Blender was able to use CUDA to initiate GPU rendering and baking. Problem solved!

3
  • The CUDA downloads page gives a choice between the "network installer" or the "local package installer". I used "network installer" and all went well. Following step 6, some downloads are served from your default aptitude server; while others come from developer.download.nvidia.com.
    – user643722
    Aug 5, 2015 at 12:43
  • ubuntu 15 reports unable to locate package cuda
    – Siddharth
    Nov 20, 2015 at 19:18
  • @Siddharth, I'd encourage you to check the solution I marked above as "answering this question". This will resolve the issue of Nvidia and CUDA utilization. :)
    – Rebel
    Nov 21, 2015 at 7:59
0

TL;DR: Some files are missing To get them, run the command below in your terminal

Note: replace version number with the version number of Blender you are using.

$ wget https://download.blender.org/release/Blender2.83/blender-2.83.5-linux64.tar.xz && \
sudo tar -C /usr/share/blender/scripts/addons/cycles/ \
-xvf blender-2.83.5-linux64.tar.xz \
blender-2.83.5-linux64/2.83/scripts/addons/cycles/lib/ \
--strip-components=5 && \
rm -f blender-2.83.5-linux64.tar.xz

After that restart Blender.


Blender from Debian/Ubuntu repository is missing some files for Cycles CUDA/GPU rendering to work.

Blender from Debian/Ubuntu repository won't work with CUDA because it was not packaged with CUDA kernel for cycles, or more specifically, the Cycles render was not packaged with some *.cubin files that should be stored /usr/share/blender/scripts/addons/cycles/lib.

Cycles without CUDA kernel

Blender installed from Debian/Ubuntu repository.

$ ls /usr/share/blender/scripts/addons/cycles/lib
ls: cannot access '/usr/share/blender/scripts/addons/cycles/lib': No such file or directory

Cycles with CUDA kernel

$ ls /usr/share/blender/scripts/addons/cycles/lib

ilter_sm_30.cubin  filter_sm_52.cubin  filter_sm_75.cubin  kernel_sm_37.cubin  kernel_sm_61.cubin
filter_sm_35.cubin  filter_sm_60.cubin  kernel_optix.ptx    kernel_sm_50.cubin  kernel_sm_70.cubin
filter_sm_37.cubin  filter_sm_61.cubin  kernel_sm_30.cubin  kernel_sm_52.cubin  kernel_sm_75.cubin
filter_sm_50.cubin  filter_sm_70.cubin  kernel_sm_35.cubin  kernel_sm_60.cubin

Summary

Those *.cubin files are essential for Cycles's CUDA/GPU rendering to work. And they are missing from the repository.

Installing nvidia-cuda-toolkit won't enable the CUDA/GPU rendering capabilities in Blender because it doesn't install Cycles CUDA kernel. You don't need to install full nvidia-cuda-toolkit, libcuda1 is enough for Cycles CUDA/GPU rendering to work.

The NVIDIA proprietary driver is needed of course.

A simple workaround

I assume that the NVIDIA driver was already installed. If you have no idea what this means, checkout this excellent AskUbuntu answer.

Download Blender from official website and extract the CUDA Cycles kernel from the tarball you downloaded to /usr/share/blender/scripts/addons/cycles/lib.

Note: Current Blender LTS version is 2.83 Change the Blender version below accordingly if you are using other version of Blender.

On Debian your should also run apt install libcuda1 if it was not automatically installed after installing nvidia-driver

$ sudo tar -C /usr/share/blender/scripts/addons/cycles/ \
-xvf blender-2.83.5-linux64.tar.xz \
blender-2.83.5-linux64/2.83/scripts/addons/cycles/lib/ \
--strip-components=5

Restart Blender and you should have a working Cycles with CUDA enabled.

A harder workaround

You can compile Cycles CUDA kernel yourself. Visit Blender Wiki for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .