Installation
============

NumbaPro is part of the `Anaconda Accelerate` product.  Please refer to the
`Anaconda Accelerate Documentation`_
for instructions on downloading and installation.

Purchasing a License
---------------------

Accelerate is included with `Anaconda Workgroup and Anaconda Enterprise subscriptions <https://www.continuum.io/content/anaconda-subscriptions>`_.

To start a 30-day free trial just download and install the Anaconda Accelerate package.

If you already have `Anaconda <http://continuum.io/downloads.html>`_
(free Python distribution) installed::

    conda update conda
    conda install accelerate

If you do not have Anaconda installed, you can download it
`here <http://continuum.io/downloads.html>`_.

Anaconda Accelerate can also be installed into your own (non-Anaconda) Python environment. For more information about Accelerate please contact `sales@continuum.io <mailto:sales@continuum.io>`_.

Update Instructions
-------------------
With Anaconda Accelerate already installed, first update
the conda_ package management tool to the latest version, then use conda
to update the NumbaPro module. In the terminal:

.. code-block:: bash

    $ conda update conda
    $ conda update numbapro
    
    
CUDA GPUs Setup
---------------

CUDA Driver
~~~~~~~~~~~~

NumbaPro does not ship the CUDA driver.  It is users responsibility to ensure
their systems are using the **latest driver**.
Currently, users should use the driver shipped with `CUDA 5.5 SDK`_.

CUDA Support & Detection
~~~~~~~~~~~~~~~~~~~~~~~~

NumbaPro GPU support currently requires `NVIDIA CUDA GPUs`_ with 
**compute-capability 2.0 or above**.
Users should check their hardware with the following:

.. code-block:: python
    
    import numbapro
    numbapro.check_cuda()

.. doctest::
    :hide:
    
    >>> import numbapro
    >>> callable(numbapro.check_cuda)
    True

A sample output looks like::

    ------------------------------libraries detection-------------------------------
    Finding cublas
    	located at /Users/.../lib/libcublas.dylib
    Finding cusparse
    	located at /Users/.../lib/libcusparse.dylib
    Finding cufft
    	located at /Users/.../lib/libcufft.dylib
    Finding curand
    	located at /Users/.../lib/libcurand.dylib
    Finding nvvm
    	located at /Users/.../lib/libnvvm.dylib
    In /Users/.../lib
    	finding libdevice.compute_20.bc 	ok
    	finding libdevice.compute_30.bc 	ok
    	finding libdevice.compute_35.bc 	ok
    -------------------------------hardware detection-------------------------------
    Found 1 CUDA devices
    id 0         GeForce GT 650M                              [SUPPORTED]
                          compute capability: 3.0
                               pci device id: 0
                                  pci bus id: 1
    Summary:
    	1/1 devices are supported

This performs CUDA library and GPU detection.
Discovered GPUs are listed with information for compute capability and whether
it is supported by NumbaPro.

The message "cuda disabled by user" means that either the environment
variable NUMBA_DISABLE_CUDA is set to 1 and must be set to 0, or the system is
32-bit. CUDA does not support 32-bit systems.

.. _`Anaconda Accelerate Documentation`: http://docs.continuum.io/accelerate/index.html

.. _conda: http://docs.continuum.io/conda/index.html

.. _`NVIDIA CUDA GPUs`: https://developer.nvidia.com/cuda-gpus

.. _`CUDA 5.5 SDK`: https://developer.nvidia.com/cuda-toolkit
