Installing PyCUDA on Ubuntu 8.10
I had to spend a bit of time working out the install procedure for PyCUDA on Ubuntu 8.10. So I thought I’d share…
cd downloads/
Install the CUDA toolkit. Ubuntu already comes with the 177.80 NVidia driver, so I didn’t install v177.73.
# install CUDA
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/driver/NVIDIA-Linux-x86_64-177.73-pkg2.run
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/sdk/NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run
chmod +x *.run
sudo ./NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
# accepted default install location: /usr/local/cuda
su -
echo "include /usr/local/cuda/lib" >> /etc/ld.so.conf.d/cuda.conf
ldconfig
cd /usr/bin/
ln -s /usr/local/cuda/open64/bin/* .
exit
Install Boost libs, v1.35.
sudo apt-get install libboost-python1.35-dev
Install PyCUDA.
wget http://pypi.python.org/packages/source/p/pycuda/pycuda-0.91.tar.gz#md5=339dac0641cc5da2f5c153d134592ed3
tar -zxvf pycuda-0.91.tar.gz
cd pycuda-0.91/
./configure
Edit siteconf.py to look like this…
BOOST_INC_DIR = ['/usr/include/boost/']
BOOST_LIB_DIR = ['/usr/lib']
BOOST_PYTHON_LIBNAME = ['boost_python-mt-py25']
CUDA_ROOT = '/usr/local/cuda/'
CUDADRV_LIB_DIR = []
CUDADRV_LIBNAME = ['cuda']
CXXFLAGS = []
LDFLAGS = []
Then take her home…
python setup.py build
sudo make install
Now to test:
#export C_INCLUDE_PATH=/usr/local/cuda/include/
#export CPLUS_INCLUDE_PATH=/usr/local/cuda/include/
export PATH=$PATH:/usr/local/cuda/bin/
cd test
python test_driver.py
The tests run successfully for me, sans test_mempool (__main__.TestCuda). I’ll update this as I find out more.








February 18th, 2009 at 7:10 am
Thanks for the post. It was a great help for me.
Addition notes:
To install CUDA drivers you need to turn off xserver (aka gdm). To do this:
sudo /etc/init.d/gdm stopctrl-F1 (to see a login prompt) and log in
Now you can install the CUDA drivers.
sudo /etc/init.d/gdm startDetails: http://www.nvnews.net/vbulletin/showthread.php?t=79966