-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cuda-9.0: Rebuild to update cudnn from 7.0 to 7.3.1
Binary (wheel) download of tensorflow seems to require cuda-9.0 and cudnn>=7.2.1. Error with newer cuda: ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory Error with older cudnn: Loaded runtime CuDNN library: 7.0.5 but source was compiled with: 7.2.1. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration. We can only select from versions offered by nvidia. cudNN 7.2.* os not available there. SO use latest for cuda 9.0 which is 7.3.1.20 currently. https://developer.nvidia.com/rdp/cudnn-download
- Loading branch information
Showing
1 changed file
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#! /bin/bash | ||
|
||
PKG=cuda | ||
MAJOR=9.0 | ||
MINOR=176 | ||
VERSION=${MAJOR}.${MINOR} | ||
BUILD=1 | ||
DRIVERVERSION=384.81 | ||
|
||
# get versions combination and file URL from | ||
# https://developer.nvidia.com/cuda-downloads?target_os=Linux | ||
# Linux - x86_64 - any - any - runfile (local) | ||
# | ||
# the cuda toolkit comes bundled with a (kernel) driver. Here we only install the toolkit. | ||
# It seems to function with other driver versions, but this can't be relied on. | ||
|
||
# Additonal we insall cudnn7 which comes in variants for each cuda version. | ||
CUDNNFILE=cudnn-$MAJOR-linux-x64-v7.3.1.20.tgz | ||
# | ||
# this file can only be downloaded with a developer login. Dowload drom | ||
# https://developer.nvidia.com/cudnn | ||
# and put the file into /package/cuda/src | ||
|
||
# Note: | ||
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html | ||
# "The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes." | ||
|
||
#PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
PREFIX=/dev/shm/$PKG-$VERSION-$BUILD | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | ||
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | ||
mkdir -p $BUILD_TMPDIR/home | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
export LD_LIBRARY_PATH=$PREFIX/lib64\${LD_LIBARRY_PATH:+:\$LD_LIBARRY_PATH} | ||
EOF | ||
. $PREFIX/profile | ||
|
||
export MAKEFLAGS="-j $(nproc)" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
# URL from https://developer.nvidia.com/cuda-downloads?target_os=Linux | ||
# Linux - x86_64 - any - any - runfile (local) | ||
|
||
INSTALLFILE=cuda_${VERSION}_${DRIVERVERSION}_linux-run | ||
URL=https://developer.nvidia.com/compute/cuda/$MAJOR/Prod/local_installers/$INSTALLFILE | ||
|
||
if [ ! -e ${INSTALLFILE} ]; then | ||
wget $URL | ||
fi | ||
|
||
# We have the first-level of "Makeself tool" generated script/archive. | ||
# We just extract to tmp and dont run the content | ||
|
||
test -d "cuda" || bash ${INSTALLFILE} --nox11 --target cuda --noexec | ||
cd cuda | ||
|
||
# we dont run the installer. | ||
# perl ./cuda-installer.pl --silent --toolkit --toolkitpath=${PREFIX} --verbose | ||
# would do all kind of stupid things and the call in run-files | ||
# ./cuda-linux.9.1.85-23083092.run --nox11 -- --noprompt --prefix="/dev/shm/x" --manifest="/dev/shm/x/bin/.uninstall_manifest_do_not_delete.txt" | ||
# | ||
# instead do it ourself | ||
cd run_files | ||
script=cuda-linux.*.run | ||
|
||
# again, cuda-linux-SOMETHING.run is a "Makeself tool" generated script. | ||
# We just extract to tmp and dont run the content | ||
|
||
test -d cuda-linux || bash $script --nox11 --target cuda-linux --noexec | ||
cd cuda-linux | ||
|
||
# we dont run the installer | ||
# perl ./install-linux.pl --prefix=$PREFIX --noprompt | ||
# would do all kind of stupid things like deleting evertyhing in $PREFIX | ||
# the main thing it does is this: | ||
|
||
find * -type d -prune -exec cp -a {} $PREFIX/ \; | ||
|
||
# copy the samples.... | ||
# | ||
|
||
#cd .. | ||
#script=cuda-samples.*.run | ||
#test -d cuda-samples || bash $script --nox11 --target cuda-samples --noexec | ||
#cd cuda-samples | ||
#cp -a samples $PREFIX/ | ||
|
||
# cudNN | ||
# | ||
|
||
cd $BUILDDIR | ||
test -e $CUDNNFILE || cp /package/cuda/src/$CUDNNFILE . | ||
test -d cudnn || mkdir cudnn | ||
cd cudnn | ||
tar xvf ../$CUDNNFILE | ||
cp cuda/include/cudnn.h $PREFIX/include/ | ||
cp cuda/lib64/libcudnn* $PREFIX/lib64/ | ||
|
||
exit |