File: install-cuda

package info (click to toggle)
ccache 4.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,188 kB
  • sloc: cpp: 47,282; asm: 28,570; sh: 8,674; ansic: 5,357; python: 685; perl: 68; makefile: 23
file content (34 lines) | stat: -rwxr-xr-x 756 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Version is given in the CUDA variable.

set -eux

retry() {
    local i=0
    while [ $i -lt 3 ]; do
        if "$@"; then
            return 0
        fi
        i=$((i + 1))
    done
    return 1
}

echo "Installing CUDA support"

retry wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
retry sudo apt-get update -qq

cuda_prefix=${CUDA:0:4}
cuda_prefix=${cuda_prefix/./-}
retry sudo apt-get install --allow-unauthenticated -y \
    cuda-command-line-tools-${cuda_prefix} \
    libcurand-dev-${cuda_prefix}

retry sudo apt-get clean

cuda_home=/usr/local/cuda-${CUDA:0:4}
$cuda_home/bin/nvcc --version
echo "${cuda_home}/bin" >>$GITHUB_PATH