GPU Rendering with Cycles - Complete Guide

…solved…

I recently purchased a GTX 960 (4 gig VRAM) with Linux driver 352.63 on Linux Mint 17.2-64 bit. Installed the CUDA toolkit 7.5 for Trusty (Ubuntu 14.04) via running the .deb file, then in terminal sudo apt-get install cuda. All this worked flawlessly, with nil hiccups. Went into System Setting -> Device Manager: 4 driver options

  1. nvidia-346
  2. nvidia-352
  3. xserver-xorg-video-nouveau
  4. nvidia-352-updates (this one I re-selected, even though the cuda install in terminal set it back to option 2: nvidia-352)

Brought up Blender, loaded a simple apple downloaded from BlendSwap (so, only a small file), still getting the ILLEGAL_ADDRESS in cuCtxSynchronise() error.

This file loads and Cycles is happy in Windows 7 64-bit. I’m pretty sure I’ve done just about everything I can to resolve the issue from a driver/toolkit-installation/activation standpoint. Baffled as to why this is still not working.

Any suggestions? :confused:

Thank you for your reply, Yafu.

I am running Blender 2.76 hash: 48f7dd6, downloaded from Blender.org.

[looking in Synaptic Package manager]
I have nvidia-modprobe installed. I have blender 2.71 installed from the repositories. I run Blender 2.76 from my /home/robyn/blender276 folder.

I’ll try to download and unarchive blender again… perhaps the build is older or something.

So, currently, I am running:

Blender 2.76b 64-bit (hash: f337fea)
Nvidia driver: nvidia-355.11-0ubuntu0-gpu14.04.2

Cuda toolkit and otherf fluff uninstalled with sudo apt-get autoremove

Thanks for your help! Blender is not registering a GPU compute device, though. have to dig some more.

Hi. Remember that you must reboot the system after installing nvidia-modprobe.
You open the terminal and you tell me what you get with each of the next commands:

cat /proc/driver/nvidia/version
lspci | grep -iE 'vga|3D'
sudo dpkg -l | grep -i nvidia

So, I went into Driver Manager and select the 358 driver. GPU / CUDA support then showed up under System in User Preferences, but that same (original) error occurred. I read elsewhere an older nvidia driver is recommended. I installed 3.4 from the repositories, but it didn’t show up in Driver Manager. The oldest one I see in the list (346 / 352 / 252-updates / 355 /358) is 346.

With all these drivers installed, wonder if there’s a conflict there.

Also, the little not at the bottom of the driver manager says “no proprietary drivers are in use”, even though per the radio button, nvidia-355 is active.

That’s why I asked you to give me that information in the previous message.

I have a GTX 960 and Kubuntu 14.04 64 bits, no problem with newst nvidia drivers.

Thanks for replying, Yafu.

cat /proc/driver/nvidia/version produced:

NVRM version: NVIDIA UNIX x86_64 Kernel Module 358.16 Mon Nov 16 19:25:55 PST 2015GCC version: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

lspci | grep -iE ‘vga|3D’ produced:

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1401 (rev a1)

…and sudo dpkg -l | grep -i nvidia produced:

ii  bbswitch-dkms                               0.7-2ubuntu1                                           amd64        Interface for toggling the power on nVidia Optimus video cardsii  libcg:amd64                                 3.1.0013-1                                             amd64        Nvidia Cg core runtime library
ii  libcggl:amd64                               3.1.0013-1                                             amd64        Nvidia Cg Opengl runtime library
rc  libcuda1-340                                340.76-0ubuntu1~xedgers14.04.4                         amd64        NVIDIA CUDA runtime library
rc  libcuda1-346                                346.72-0ubuntu1                                        amd64        NVIDIA CUDA runtime library
rc  libcuda1-352                                352.63-0ubuntu1                                        amd64        NVIDIA CUDA runtime library
rc  libcuda1-352-updates                        352.63-0ubuntu0.14.04.1                                amd64        NVIDIA CUDA runtime library
ii  libcuda1-355                                355.11-0ubuntu0~gpu14.04.2                             amd64        NVIDIA CUDA runtime library
rc  libcuda1-358                                358.16-0ubuntu0~gpu14.04.2                             amd64        NVIDIA CUDA runtime library
rc  nvidia-304-updates                          304.131-0ubuntu0.14.04.1                               amd64        NVIDIA legacy binary driver - version 304.131
rc  nvidia-340                                  340.76-0ubuntu1~xedgers14.04.4                         amd64        NVIDIA binary driver - version 340.76
rc  nvidia-346                                  346.72-0ubuntu1                                        amd64        NVIDIA binary driver - version 346.72
rc  nvidia-352                                  352.63-0ubuntu1                                        amd64        NVIDIA binary driver - version 352.63
rc  nvidia-352-updates                          352.63-0ubuntu0.14.04.1                                amd64        NVIDIA binary driver - version 352.63
ii  nvidia-355                                  355.11-0ubuntu0~gpu14.04.2                             amd64        NVIDIA binary driver - version 355.11
rc  nvidia-358                                  358.16-0ubuntu0~gpu14.04.2                             amd64        NVIDIA binary driver - version 358.16
ii  nvidia-cg-dev:amd64                         3.1.0013-1                                             amd64        Cg Toolkit - GPU Shader Authoring Language (headers)
ii  nvidia-cg-toolkit                           3.1.0013-1                                             amd64        Cg Toolkit - GPU Shader Authoring Language
rc  nvidia-libopencl1-340                       340.76-0ubuntu1~xedgers14.04.4                         amd64        NVIDIA OpenCL Driver and ICD Loader library
ii  nvidia-modprobe                             352.63-0ubuntu1                                        amd64        Load the NVIDIA kernel driver and create device files
rc  nvidia-opencl-icd-340                       340.76-0ubuntu1~xedgers14.04.4                         amd64        NVIDIA OpenCL ICD
rc  nvidia-opencl-icd-346                       346.72-0ubuntu1                                        amd64        NVIDIA OpenCL ICD
rc  nvidia-opencl-icd-352                       352.63-0ubuntu1                                        amd64        NVIDIA OpenCL ICD
rc  nvidia-opencl-icd-352-updates               352.63-0ubuntu0.14.04.1                                amd64        NVIDIA OpenCL ICD
ii  nvidia-opencl-icd-355                       355.11-0ubuntu0~gpu14.04.2                             amd64        NVIDIA OpenCL ICD
rc  nvidia-opencl-icd-358                       358.16-0ubuntu0~gpu14.04.2                             amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                                0.6.2linuxmint1                                        amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                             358.16-0ubuntu0~gpu14.04.1                             amd64        Tool for configuring the NVIDIA graphics driver

Thank you for considering my problem.

ETA: oh, and I did reboot between graphics drivers changes… failed to mention that, sorry.

So you say that currently you have installed 358.16 packages.

Are you getting this CUDA error with any scene, even with the default cube?

Have you searched in Google about that error that you get?

CUDA error: ILLEGAL_ADDRESS in cuCtxSynchronize()

Edit:
You have correctly installed the driver. It seems that the message “no proprietary drivers are in use” does not mean it is incorrectly installed.

That’s correct - I get it all the time, with even minimal scenes (hardly anything in them. I think it’s time for a reinstall of the OS. Might just back my software up with Aptik, then just do that. Be quicker and easier than trying to figure out what I’ve messed up.
Thanks so much for your help, Yafu!

Back to square one: I’m running Linux Mint 17.3 64-bit. Graphics driver for my GTX-960: 352.68. Double-checked on nvidia-modprobe… it is installed and at the latest version. My driver manager dialogue:
http://www.tightbytes.com/images/Screenshot-GraphicsDrivers.png

cat /proc/driver/nvidia/version produced:

NVRM version: NVIDIA UNIX x86_64 Kernel Module 352.68 Tue Dec 1 17:24:11 PST 2015
GCC version: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

lspci | grep -iE ‘vga|3D’ produced:

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1401 (rev a1)

…and sudo dpkg -l | grep -i nvidia produced:

ii bbswitch-dkms 0.7-2ubuntu1 amd64 Interface for toggling the power on nVidia Optimus video cards
ii libcg:amd64 3.1.0013-1 amd64 Nvidia Cg core runtime library
ii libcggl:amd64 3.1.0013-1 amd64 Nvidia Cg Opengl runtime library
rc libcuda1-340 340.76-0ubuntu1~xedgers14.04.4 amd64 NVIDIA CUDA runtime library
rc libcuda1-346 346.72-0ubuntu1 amd64 NVIDIA CUDA runtime library
ii libcuda1-352 352.68-0ubuntu1 amd64 NVIDIA CUDA runtime library
rc libcuda1-352-updates 352.63-0ubuntu0.14.04.1 amd64 NVIDIA CUDA runtime library
rc libcuda1-355 355.11-0ubuntu0~gpu14.04.2 amd64 NVIDIA CUDA runtime library
rc libcuda1-358 358.16-0ubuntu0~gpu14.04.2 amd64 NVIDIA CUDA runtime library
rc nvidia-304-updates 304.131-0ubuntu0.14.04.1 amd64 NVIDIA legacy binary driver - version 304.131
rc nvidia-340 340.76-0ubuntu1~xedgers14.04.4 amd64 NVIDIA binary driver - version 340.76
rc nvidia-346 346.72-0ubuntu1 amd64 NVIDIA binary driver - version 346.72
ii nvidia-352 352.68-0ubuntu1 amd64 NVIDIA binary driver - version 352.68
rc nvidia-352-updates 352.63-0ubuntu0.14.04.1 amd64 NVIDIA binary driver - version 352.63
rc nvidia-355 355.11-0ubuntu0~gpu14.04.2 amd64 NVIDIA binary driver - version 355.11
rc nvidia-358 358.16-0ubuntu0~gpu14.04.2 amd64 NVIDIA binary driver - version 358.16
ii nvidia-cg-dev:amd64 3.1.0013-1 amd64 Cg Toolkit - GPU Shader Authoring Language (headers)
ii nvidia-cg-toolkit 3.1.0013-1 amd64 Cg Toolkit - GPU Shader Authoring Language
rc nvidia-libopencl1-340 340.76-0ubuntu1~xedgers14.04.4 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-modprobe 352.68-0ubuntu1 amd64 Load the NVIDIA kernel driver and create device files
rc nvidia-opencl-icd-340 340.76-0ubuntu1~xedgers14.04.4 amd64 NVIDIA OpenCL ICD
rc nvidia-opencl-icd-346 346.72-0ubuntu1 amd64 NVIDIA OpenCL ICD
ii nvidia-opencl-icd-352 352.68-0ubuntu1 amd64 NVIDIA OpenCL ICD
rc nvidia-opencl-icd-352-updates 352.63-0ubuntu0.14.04.1 amd64 NVIDIA OpenCL ICD
rc nvidia-opencl-icd-355 355.11-0ubuntu0~gpu14.04.2 amd64 NVIDIA OpenCL ICD
rc nvidia-opencl-icd-358 358.16-0ubuntu0~gpu14.04.2 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6.2linuxmint1 amd64 Tools to enable NVIDIA’s Prime
ii nvidia-settings 358.16-0ubuntu0~gpu14.04.1 amd64 Tool for configuring the NVIDIA graphics driver

I tried looking up dpkg to determine what those ii and rc line prefixes meant: sort-of got that whilst the driver was uninstalled, the config files were still present. In Blender under User Preferences -> System tab, no GPU is listed under Compute Device. So, something is missing?

ETA: nvidia-detector returns: none

Every thread and post on like Blender.StackEchange and elsewhere that deals with this issue finds resolution with the poster downgrading the nvidia driver (and the CUDA toolkit as well). Just curious if anyone else is having dramas in Ubuntu-flavoured distros with nvidia and cuda.
:eek:

No problems using Kubuntu 14.04 64bits, nvidia 358.16 from here:
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

nvidia-modprobe installed. I have not installed CUDA toolkit, using official Blender 2.76b.

Have you reported this problem to the Linux Mint maintainers?

Not yet, Yafu, but I am looking in that direction, now. Almost consistently, the problem appears to resolve with the installation of modprobe… except in my case.
When I encounter this sort of exclusive problem that I see echoed nowhere else, I can’t help but think I stuffed something up, somewhere. But what? where? I might end up going with some other distro if this final re-install of Rosa doesn’t produce results.

So, here is my post from the Linux Mint forums:

I’ve just upgraded my desktop to 17.3 (Rosa) - 64-bit. I have installed an nvidia gtx-960 graphics card with 4gig VRAM that I’d like to use in Blender.
I have installed the 258.16 driver, which I’m supposing has CUDA as part of the package (is that right?) using the instructions on this page. Specifically:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt-get install nvidia-358 nvidia-settings

In my Menu -> System Settings -> Driver Manager, it states I have no proprietary drivers in use, and indicates that nvidia-358 (open-source) is the active one.

I have followed your suggestion to download and install the modprobe file you linked to, above (and rebooted). However, Blender 2.76b does not offer CUDA as an option for ‘Compute Device’.

…then…

Further to this, I decided to get on the nvidia site to see if there was a newer, better driver for this card. When I typed in the card, OS and did a search, the site indicated the driver it was going to allow me to download was 352.63, which is actually already an (unselected) option in Driver Manager. Additionally, this driver is not an open-source one.
So, I’ve enabled (selected) it and after quite a while waiting to ‘apply changes’, rebooted to allow the new driver to take effect - assuming that my newly-installed modprobe will detect the driver and ferret out CUDA if it is indeed part of the driver.

I have rebooted and indeed, now Blender offers CUDA as an option under User Preferences -> System -> Compute Device.

I’m posting this not as the definitive solution for any and all, but it might possibly keep someone else from tearing out the last shred of hair trying to solve this little conundrum.

BTW: the Devices Manager looks EXACTLY as it did before. I’m using EXACTLY the driver I had used before. About the only thing I can think of was that modprobe - despite it being for version 340.x - was the exact right one to detect that particular driver and its cuda components.
ETA: I did try to download / install it, but at the time got an error (gdebi) that a newer version had been installed already, so I assumed I had the modprobe I needed and had to look elsewhere for a solution.

Right now I am doing the final render on my light-saber and previously when I would render objects with around 1000-3000 samples depending on the complexity it would take maybe an hour but now blender says it will take 69 HOURS to render this light saber and only uses 2000 samples. My system hardware consists of a GTX 970, 16 GB of RAM and an Intel i7-4790k CPU running currently at 4.5 GHZ http://i.stack.imgur.com/jE29G.png.I am just very confused why on the render it says that it is only using around 18.37mg of ram when I have 16 GIGABYTES. I’ve set blender to high priority in Windows Task Manager and im just confused on why its using so little resources and why is it taking so long to render everything. http://i.stack.imgur.com/EdOT4.png

my desktop uses a GTX 660, and my laptop has a 940m
when i render in my desktop, the comp becomes slow. but when i render with my laptop, it is able to perform any other operation just fine. im currently using 2.76 on both machines. so what exactly is the problem?

In addition to setting Blender to use GPU in Prefs, did you set the desktop Blender to use “GPU Compute” in the Render panel?


BTW, is the FAQ in the first post (Feb 2013) still relevant after 3yrs, and
is there a valid link?

I’m getting the same thing, security warning and log-in request. It’s been ten months now.

Hi,

I’m on arch linux.

hardware:
_PCI nvidia GTX-750
_CPU core i7 4790

software:
_kernel 4.7.2-1-ARCH
_blender 2.77a-6

installed:
_nvidia-dkms 370.23-4
_nvidia-cg-toolkit 3.1-4
_nvidia-utils 370.23-1
_opencl-nvidia 370.23-1
_libvdpau 1.1.1-2
_cuda 7.5.18-4
_bumblebee 3.2.1-12

nvidia-modprobe load all the modules (lsmod | grep nvidia show them all loaded: https://ptpb.pw/xDdq)
lspci -k show me that my VGA GPU nvidi use the nvidia driver and my Intel graphic part use i915 (from x86-video-intel package driver)
optirun glxgears -info show my GPU nvidia working fine: https://ptpb.pw/owFM.txt

but finally, optirun blender make blender running, and when i go through “File” menu tab and “User preferences” and tab “system”, blender crash (directly when clic on system tab).
impossible to make it running with my GPU nvidia.
message from /tmp/blender.crash.txt : https://ptpb.pw/TYb8

This happen on my desktop computer here, but also the same way on my laptop (i7 graphic from intel and GPU nvidia gtx-950M)

i’m searching some help for find a solution to make running and working blender with my GPU nvidia on archlinux and be able to use intel to print on screen and nvidia for render things (so use bumblebee… or other if you know, tell me).