Installing CUDA, PyCUDA on Ubuntu
Installing CUDA on Ubuntu Linux 1 Cuda download site https://developer.nvidia.com/cuda-downloads $ sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb $ sudo apt-get update $ sudo apt-get install cuda $ vim ~/.bashrc # cuda export CUDA_HOME=/usr/local/cuda export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 export PATH=${CUDA_HOME}/bin:${PATH} $source ~/.bashrc $ cuda-install-samples-7.5.sh ~ $ cd ~/NVIDIA_CUDA-7.5_Samples $ cd 1_Utilities/deviceQuery $ make
Installing PyCUDA on Ubuntu Linux 2 Step 0: Ensure that CUDA is installed and settings are correct Step 1: Install gcc4.8 (Ubuntu 14.04) Step 2: Install Boost C++ libraries Step 3: Install numpy $ Numpy download site http://sourceforge.net/projects/numpy/files/ $ sudo apt-get install build-essential gcc-4.8 g++-4.8 $ cd /usr/bin $ sudo ln -sf gcc-4.8 gcc $ sudo apt-get install libboost-all-dev $ sudo apt-get install python-numpy –y $ cd pycuda-VERSION $ sudo "python distribute_setup.py" $ sudo "easy_install numpy" $ sudo apt-get install git $git clone http://github.com/numpy/numpy.git numpy
Step 4: Download, unpack and install PyCUDA Download pycuda https://pypi.python.org/pypi/pycuda $ sudo apt-get install build-essential python-dev python-setuptools libboost-python-dev libboost-thread-dev –y $ tar xzvf pycuda-VERSION.tar.gz $ cd pycuda-VERSION $ ./configure.py --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python-py27 --boost-thread-libname=boost_thread $ make -j 4 $ sudo python setup.py install $ sudo pip install . $ ./configure.py --python-exe=/usr/bin/python3 --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python-mt-py32 --boost-thread-libname=boost_thread-mt --no-use-shipped-boost $ sudo python3 setup.py install
Step 5: Import pycuda on system python $ cd /usr/bin $ ./python [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pycuda >>> dir(pycuda) ['VERSION', 'VERSION_STATUS', 'VERSION_TEXT', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] >>> pycuda.VERSION (2015, 1, 3) >>> import numpy >>> numpy.__version__ '1.8.2'
Installing PyCUDA on anaconda python 3 Step 0: Anaconda download site https://www.continuum.io/downloads Step 1: Python path setting Step 2: Install pycuda $bash Anaconda2-2.4.1-Linux-x86_64.sh $vim ~/.bashrc # python export PYTHONPATH=“/home/nh/anaconda2/bin:$PYTHONPATH” $sourcd ~/.bashrc $ cd anaconda2 $ conda install pip $ pip install pycuda
Step 3: Import cuda on anaconda python Python 2.7.11 |Anaconda 2.4.1 (64-bit)| (default, Dec 6 2015, 18:08:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org >>> import pycuda >>> dir(pycuda) ['VERSION', 'VERSION_STATUS', 'VERSION_TEXT', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']