Skip to content

Commit

Permalink
fix cuda version detection mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
cwharris committed Nov 28, 2023
1 parent 35596fe commit 0f87bb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion features/src/cuda/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}";
Expand Down

0 comments on commit 0f87bb1

Please sign in to comment.