Skip to content

Commit

Permalink
Update install_cuda_ubuntu.sh as per marian-nmt#932
Browse files Browse the repository at this point in the history
  • Loading branch information
XapaJIaMnu committed May 18, 2022
1 parent e4484da commit 1956739
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/ci/install_cuda_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ CUDA_PACKAGES_IN=(

CUDA_PACKAGES=""
for package in "${CUDA_PACKAGES_IN[@]}"; do
# @todo This is not perfect. Should probably provide a separate list for diff versions
# cuda-compiler-X-Y if CUDA >= 9.1 else cuda-nvcc-X-Y
if [[ "${package}" == "nvcc" ]] && version_ge "$CUDA_VERSION_MAJOR_MINOR" "9.1" ; then
package="compiler"
elif [[ "${package}" == "compiler" ]] && version_lt "$CUDA_VERSION_MAJOR_MINOR" "9.1" ; then
package="nvcc"
fi
# Build the full package name and append to the string.
CUDA_PACKAGES+=" cuda-${package}-${CUDA_MAJOR}-${CUDA_MINOR}"
done
Expand All @@ -72,8 +79,8 @@ echo "CUDA_PACKAGES ${CUDA_PACKAGES}"

PIN_FILENAME="cuda-ubuntu${UBUNTU_VERSION}.pin"
PIN_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}/x86_64/${PIN_FILENAME}"
APT_KEY_URL="http://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}/x86_64/7fa2af80.pub"
REPO_URL="http://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}/x86_64/"
APT_KEY_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}/x86_64/3bf863cc.pub"
REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}/x86_64/"

echo "PIN_FILENAME ${PIN_FILENAME}"
echo "PIN_URL ${PIN_URL}"
Expand All @@ -91,7 +98,7 @@ sudo add-apt-repository "deb ${REPO_URL} /"
sudo apt-get update

echo "Installing CUDA packages ${CUDA_PACKAGES}"
sudo apt-get -y install ${CUDA_PACKAGES}
sudo apt-get -y --allow-unauthenticated install ${CUDA_PACKAGES}

if [[ $? -ne 0 ]]; then
echo "CUDA Installation Error."
Expand Down

0 comments on commit 1956739

Please sign in to comment.