File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 29
29
# because in some cases a single Docker image can have multiple CUDA versions
30
30
# on it, and `nvcc --version` might not show the CUDA version we want.
31
31
if [[ -n " $DESIRED_CUDA " ]]; then
32
- # cu90, cu92, cu100, cu101
33
- if [[ ${# DESIRED_CUDA} -eq 4 ]]; then
34
- CUDA_VERSION=" ${DESIRED_CUDA: 2: 1} .${DESIRED_CUDA: 3: 1} "
35
- elif [[ ${# DESIRED_CUDA} -eq 5 ]]; then
36
- CUDA_VERSION=" ${DESIRED_CUDA: 2: 2} .${DESIRED_CUDA: 4: 1} "
32
+ # If the DESIRED_CUDA already matches the format that we expect
33
+ if [[ ${DESIRED_CUDA} =~ ^[0-9]+\. [0-9]+$ ]]; then
34
+ CUDA_VERSION=${DESIRED_CUDA}
35
+ else
36
+ # cu90, cu92, cu100, cu101
37
+ if [[ ${# DESIRED_CUDA} -eq 4 ]]; then
38
+ CUDA_VERSION=" ${DESIRED_CUDA: 2: 1} .${DESIRED_CUDA: 3: 1} "
39
+ elif [[ ${# DESIRED_CUDA} -eq 5 ]]; then
40
+ CUDA_VERSION=" ${DESIRED_CUDA: 2: 2} .${DESIRED_CUDA: 4: 1} "
41
+ fi
37
42
fi
38
43
echo " Using CUDA $CUDA_VERSION as determined by DESIRED_CUDA"
39
44
You can’t perform that action at this time.
0 commit comments