From 0f87bb14748a1c3c6125761472c2e4ea6c599aa9 Mon Sep 17 00:00:00 2001 From: Christopher Harris Date: Tue, 28 Nov 2023 13:31:57 -0600 Subject: [PATCH] fix cuda version detection mechanism --- features/src/cuda/install.sh | 2 +- .../opt/rapids-build-utils/bin/make-conda-env.sh | 2 +- .../opt/rapids-build-utils/bin/make-pip-env.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/src/cuda/install.sh b/features/src/cuda/install.sh index 9cf76a78..2246ddca 100644 --- a/features/src/cuda/install.sh +++ b/features/src/cuda/install.sh @@ -65,7 +65,7 @@ echo "Installing dev CUDA toolkit..."; export CUDA_HOME="/usr/local/cuda"; cuda_ver="${VERSION}"; -cuda_ver=$(cut -d'.' -f3 --complement <<< "${cuda_ver}"); +cuda_ver=$(grep -o '^[0-9]*.[0-9]' <<< "${cuda_ver}"); cudapath="${CUDA_HOME}-${cuda_ver}"; cuda_tag="cuda${cuda_ver}"; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh index 7205cbe6..a8a7378f 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-conda-env.sh @@ -14,7 +14,7 @@ make_conda_env() { fi local cuda_version="${CUDA_VERSION:-${CUDA_VERSION_MAJOR:-12}.${CUDA_VERSION_MINOR:-0}}"; - cuda_version="$(cut -d'.' -f3 --complement <<< "${cuda_version}")"; + cuda_version="$(grep -o '^[0-9]*.[0-9]' <<< "${cuda_version}")"; local python_version="${PYTHON_VERSION:-$(python3 --version 2>&1 | cut -d' ' -f2)}"; python_version="$(cut -d'.' -f3 --complement <<< "${python_version}")"; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh index 6705f612..964ff095 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh @@ -14,7 +14,7 @@ make_pip_env() { fi local cuda_version="${CUDA_VERSION:-${CUDA_VERSION_MAJOR:-12}.${CUDA_VERSION_MINOR:-0}}"; - cuda_version="$(cut -d'.' -f3 --complement <<< "${cuda_version}")"; + cuda_version="$(grep -o '^[0-9]*.[0-9]' <<< "${cuda_version}")"; local cuda_version_major="$(cut -d'.' -f1 <<< "${cuda_version}")"; local python_version="${PYTHON_VERSION:-$(python3 --version 2>&1 | cut -d' ' -f2)}";