Created
May 30, 2019 00:24
-
-
Save sodonnell/ca4ebf6ffa605a85c42e6747fc31afa0 to your computer and use it in GitHub Desktop.
Automatically discover and enable NVIDIA Tesla K20/K20X GPU/CUDA devices on Red Hat Enterprise Linux (RHEL).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # /etc/init.d/nvload | |
| # | |
| # This script was used to ensure all new/existing NVIDIA GPU/CUDA devices | |
| # are loaded properly on an AMAX Tesla K20/K20X GPU Clustering platform, | |
| # running Red Hat Enterprise Linux (RHEL). | |
| # | |
| # Author: Sean O'Donnell <sean@seanodonnell.com> | |
| # | |
| /sbin/modprobe nvidia | |
| if [ "$?" -eq 0 ]; then | |
| # Count the number of NVIDIA 3D and VGA controllers found. | |
| N3D=`/sbin/lspci | grep -i NVIDIA | grep "3D controller" | wc -l` | |
| NVGA=`/sbin/lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l` | |
| N=`expr $N3D + $NVGA - 1` | |
| for i in `seq 0 $N`; do | |
| /bin/mknod -m 666 /dev/nvidia$i c 195 $i; | |
| done | |
| /bin/mknod -m 666 /dev/nvidiactl c 195 255 | |
| else | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment