File tree Expand file tree Collapse file tree 2 files changed +44
-12
lines changed Expand file tree Collapse file tree 2 files changed +44
-12
lines changed Original file line number Diff line number Diff line change 89
89
# Detect CUDA version
90
90
echo " Detecting CUDA version..."
91
91
if [ -d " /usr/local/cuda" ]; then
92
- DETECTED_CUDA=$( ls -la /usr/local/cuda | grep -o ' cuda-[0-9.]*' | head -1 | sed ' s/cuda-//' )
93
- if [ -n " $DETECTED_CUDA " ]; then
94
- CUDA_VERSION=" $DETECTED_CUDA "
95
- echo " Found CUDA version: $CUDA_VERSION "
92
+ # Use readlink to safely get the target of the symlink
93
+ if [ -L " /usr/local/cuda" ]; then
94
+ CUDA_TARGET=$( readlink /usr/local/cuda)
95
+ if [[ " $CUDA_TARGET " =~ cuda-([0-9.]+) ]]; then
96
+ DETECTED_CUDA=" ${BASH_REMATCH[1]} "
97
+ CUDA_VERSION=" $DETECTED_CUDA "
98
+ echo " Found CUDA version: $CUDA_VERSION "
99
+ fi
100
+ else
101
+ # If not a symlink, try to find cuda-* directories
102
+ for cuda_dir in /usr/local/cuda-* ; do
103
+ if [ -d " $cuda_dir " ]; then
104
+ DETECTED_CUDA=$( basename " $cuda_dir " | sed ' s/cuda-//' )
105
+ CUDA_VERSION=" $DETECTED_CUDA "
106
+ echo " Found CUDA version: $CUDA_VERSION "
107
+ break
108
+ fi
109
+ done
96
110
fi
97
111
export CUDA_HOME=" /usr/local/cuda"
98
112
else
Original file line number Diff line number Diff line change 34
34
with :
35
35
python-version : " 3.11"
36
36
37
+ - name : Cache pip dependencies
38
+ uses : actions/cache@v3
39
+ with :
40
+ path : ~/.cache/pip
41
+ key : ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
42
+ restore-keys : |
43
+ ${{ runner.os }}-pip-3.11-
44
+
45
+ - name : Cache Conda
46
+ uses : actions/cache@v3
47
+ with :
48
+ path : /opt/miniconda3
49
+ key : ${{ runner.os }}-conda-${{ hashFiles('.ci/setup.sh') }}
50
+ restore-keys : |
51
+ ${{ runner.os }}-conda-
52
+
53
+ - name : Cache Triton build
54
+ uses : actions/cache@v3
55
+ with :
56
+ path : |
57
+ ~/.triton
58
+ /tmp/triton
59
+ key : ${{ runner.os }}-triton-${{ hashFiles('.ci/install-triton.sh') }}
60
+ restore-keys : |
61
+ ${{ runner.os }}-triton-
62
+
37
63
- name : Setup environment
38
64
env :
39
65
CONDA_ENV : tritonparse
54
80
run : |
55
81
bash .ci/install-project.sh
56
82
57
- - name : Cache pip dependencies
58
- uses : actions/cache@v3
59
- with :
60
- path : ~/.cache/pip
61
- key : ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
62
- restore-keys : |
63
- ${{ runner.os }}-pip-3.11-
64
-
65
83
- name : Run tests
66
84
env :
67
85
CONDA_ENV : tritonparse
You can’t perform that action at this time.
0 commit comments