Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Try to automate CUDA dependencies installation for https://cdnnow.ru/blog/ffmpeg-cuda/
#!/bin/sh
yum -y install epel-release
yum -y install curl
rpm -q docker-release >/dev/null 2>&1 ||
yum install -y http://repo.docker.ru/pub/linux/centos/7/noarch/docker-release-1-1.el7.noarch.rpm
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" || {
REPOBASE="https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64"
REPOPKG="$(curl -sS $REPOBASE/ | egrep -o "cuda-repo-rhel7-$MAJOR.$MINOR[^']*.rpm" | tail -1)"
MINOR="${REPOPKG#*.}"
MINOR="${MINOR%%.*}"
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
You can’t perform that action at this time.