Skip to content

Commit

Permalink
Fix CUDA version detection mechanism (#179)
Browse files Browse the repository at this point in the history
* fix cuda version detection mechanism

* update feature version

* update feature version
  • Loading branch information
cwharris authored Dec 12, 2023
1 parent 7ee82e0 commit a2f5a73
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion features/src/cuda/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "CUDA Toolkit",
"id": "cuda",
"version": "24.2.0",
"version": "24.2.1",
"description": "A feature to install the NVIDIA CUDA Toolkit",
"options": {
"version": {
Expand Down
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 a2f5a73

Please sign in to comment.