Install CUDA Accelerate for Anaconda Python

The install procedure is similar for Mac, Linux, and Windows.

  1. Download Nvidia Toolkit 9.0, choosing → Linux → x86_64 → Ubuntu (pick version ≤ your install) → deb(network) and download the base installer
  2. Install CUDA Toolkit, from Linux Terminal:
    dpkg -i cuda-repo-*.deb
    
    apt update 
    apt install cuda
    
  3. Install Anaconda Accelerate. Setup a distinct conda environment for Cuda, since it requires specific module versions (some of which are not the latest).
    conda update conda
    
    conda create -n cuda
    source activate cuda
    
    conda install accelerate
    

Test

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

numba.cuda.cudadrv.libs.test()

numba.cuda.api.detect()

Examples

Notes

  • 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.
  • Fix error about having gcc too new, try update-alternatives to switch gcc versions.

Leave a Comment