Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Try to automate CUDA dependencies installation for
yum -y install epel-release
yum -y install curl
rpm -q docker-release >/dev/null 2>&1 ||
yum install -y
yum -y install ffmpeg-cuda
MAJOR="$(ldd /bin/ffmpeg-cuda | awk 'match($1, /^libnppicc\.so\.([0-9]*)/, m) { print m[1]; exit; }')"
MINOR="$(ldd /bin/ffmpeg-cuda | awk 'match($1, /^libnppicc\.so\.([0-9]*)\.([0-9]*)$/, m) { print m[2]; exit; }')"
rpm -q cuda-repo-rhel7 >/dev/null 2>&1 &&
test -n "$MINOR" || {
REPOPKG="$(curl -sS $REPOBASE/ | egrep -o "cuda-repo-rhel7-$MAJOR.$MINOR[^']*.rpm" | tail -1)"
yum install -y "$REPOBASE/$REPOPKG"
yum install -y cuda-drivers "cuda-runtime-$MAJOR-$MINOR"
## END ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment