Personal tools

HPC:CUDA

From hpcwiki

Revision as of 17:33, 21 April 2018 by Hfrancot (Talk | contribs)

Jump to: navigation, search

Contents

CUDA Development

CUDA installation process in worker nodes

Base Installation

# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -ivh epel-release-7-9.noarch.rpm
# bash NVIDIA-Linux-x86_64-390.46.run
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-11.noarch.rpm
# rpm -ivh epel-release-7-11.noarch.rpm
  • Get CUDA local installation RPM file - Result: OK
# wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64-rpm
# mv cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64-rpm cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64.rpm
  • Install CUDA package - Result: OK
# rpm -i cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64.rpm
# yum clean all
# yum install cuda

Configuration

  • Create or edit the file /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
  • Regenerate the kernel initramfs:
# dracut --force
  • Create a file /etc/profile.d/cuda.sh containing
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Test

It seems it's necessary to restart each machine, because the system must load the cuda driver (without the noveau driver) - Reboot OK (node '11')

  • Create user testing
# adduser testing
# passwd testing
  • Log in as user testing
# su testing
  • Create testing directory
$ cd
$ mkdir cuda
$ mkdir cuda/testing
  • Copy testing examples
$ cd cuda/testing
$ cuda-install-samples-8.0.sh ./
  • Enter an arbitrary example and run
$ cd NVIDIA_CUDA-8.0_Samples/0_Simple/matrixMul
$ make
$ ./matrixMul