Install CUDA Accelerate for Anaconda Python

1. Install Nvidia Toolkit

This process was done using Nvidia Toolkit 8.0 on Ubuntu 16.04. The CUDA Toolkit installer works similarly for Mac, Linux, and Windows.

Click Download > Linux > x86_64 > Ubuntu > 16.04 > deb(network) and download the base installer, then:

dpkg -i cuda-repo-*.deb

apt update 

apt install cuda

Even if you already have Continuum Accelerate (formerly NumbaPro) for Anaconda Python installed, it won’t work unless you have a CUDA >=2.0 GPU installed, and you have the CUDA drivers installed.

2. Anaconda Accelerate

Numbapro has been moved into accelerate.

conda update conda
conda install accelerate numba

3. Test Cuda for Anaconda Python

import numba.cuda.api,numba.cuda.cudadrv.libs



4. Python CUDA Examples

PyCUDA Matrix Multiplication Benchmark

Graphics Benchmarks (non-Python)

Notes on Conda Accelerate CUDA

if you get an error about having gcc too new, e.g. it says you need gcc-4.9, install by

apt install gcc-4.9 g++-4.9

and then use update-alternatives to switch to gcc-4.9