Cluster der kan alt/Installation af CUDA

From Teknologisk videncenter
< Cluster der kan alt
Revision as of 11:46, 4 November 2014 by JLA (talk | contribs) (Installation af cuda)
Jump to: navigation, search

Installation af cuda

Follow this tutorial: http://www.quantstart.com/articles/Installing-Nvidia-CUDA-on-Ubuntu-14-04-for-Linux-GPU-Computing

Note: Suggest that you navigate to sub-directories in the samples directory and "make" individual projects. To "make" the whole samples directory (as the tutorial suggests) takes around an hour!

Note: .bash_profile is actually just called .profile


CUDA + OpenMPI install script:

#!/bin/bash
echo "Preparing for install..."
apt-get update
apt-get install -y build-essential
echo "Creating folders..."
mkdir ~/installdir
mkdir ~/installdir/dl
mkdir ~/installdir/dl/CUDA
# Downloading, installing deb.
if [ -f "/home/hpcadmin/installdir/dl/CUDA/cuda-repo-ubuntu1404_6.5-14_amd64.deb" ];
then
	echo "cuda6_5_rev14 .deb package found."
	echo "Installing: cuda65rev14..."
	dpkg -i /home/hpcadmin/installdir/dl/CUDA/cuda-repo-ubuntu1404_6.5-14_amd64.deb
else
	echo "cuda6_5_rev14 .deb package _NOT_ found."
	echo "Downloading and installing: cuda6_5_rev14..."
	wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb /home/hpcadmin/installdir/dl/CUDA/
	dpkg -i /home/hpcadmin/installdir/dl/CUDA/cuda-repo-ubuntu1404_6.5-14_amd64.deb
fi
apt-get update
apt-get install -y cuda 
echo "export PATH=/usr/local/cuda-6.5/bin:$PATH" >> ~/.profile
echo "export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH" >> ~/.profile
source ~/.profile
#Installing OpenMPI
echo "Installing OpenMPI"
apt-get install -y libopenmpi-dev openmpi-bin openmpi-doc
echo "========================================="
echo "!!! CUDA + OpenMPI - INSTALL COMPLETE !!!"
echo "========================================="
echo "RESTART IN 20 SECONDS FOR DRIVERS TO WORK"
echo ""
echo "Before proceeding to test the GPU cards we will ensure that the drivers are"
echo "correctly installed. The following line will provide us with the driver version."
echo "Run this for testing after reboot: sudo cat /proc/driver/nvidia/version"
sleep 20
reboot now