Personal tools

Difference between revisions of "HPC:CUDA"

From hpcwiki

Jump to: navigation, search
(CUDA installation process in worker nodes)
(Base Installation)
Line 15: Line 15:
 
  # rpm -ivh epel-release-7-9.noarch.rpm
 
  # rpm -ivh epel-release-7-9.noarch.rpm
 
<hr/>
 
<hr/>
* ''Update (alternative) for CentOS 7.4: it is necessary to use epel v. 7.11 and to install nVidia graphics driver''
+
* ''''Update (alternative) for CentOS 7.4: it is necessary to use epel v. 7.11 and to install nVidia graphics driver''''
 
  # wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-11.noarch.rpm
 
  # 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
 
  # rpm -ivh epel-release-7-11.noarch.rpm

Revision as of 09:00, 22 April 2018

Contents

CUDA Development

CUDA installation process in worker nodes

Base Installation

This procedure is intended for CentOS 7.3, but some updates cited below allows it to configure a CentOS 7.4 worker node:

# 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

  • 'Update (alternative) for CentOS 7.4: it is necessary to use epel v. 7.11 and to install nVidia graphics driver'
# 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
# bash NVIDIA-Linux-x86_64-390.46.run

  • 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