File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,17 @@ if [ "$GPU" == "-cuda" ] && [ "$OS" == "Darwin" ]; then
101
101
exit 1
102
102
fi
103
103
104
+ # There are only two supported CUDA version. Let it fail if unsupported.
105
+ if [ " $GPU " == " -cuda" ]; then
106
+ export PATH=" /usr/local/cuda/bin:$PATH "
107
+ CUDA_MAJ=$( nvcc --version | grep -oP " (?<=release )\d+" ) || 0
108
+ if [[ $CUDA_MAJ == 12 ]]; then
109
+ CUDA_VERSION=" -12-0" ;
110
+ elif [[ $CUDA_MAJ == 11 ]]; then
111
+ CUDA_VERSION=" -11-7"
112
+ fi
113
+ fi
114
+
104
115
# Construct GitHub API URL and get latest version if not specified
105
116
if [ " $VERSION " == " latest" ]; then
106
117
API_URL=" https://api.github.com/repos/janhq/nitro/releases/latest"
116
127
# Construct download URL based on OS, ARCH, GPU and VERSION
117
128
case $OS in
118
129
Linux)
119
- FILE_NAME=" nitro-${VERSION} -linux-amd64${GPU} .tar.gz"
130
+ FILE_NAME=" nitro-${VERSION} -linux-amd64${GPU}${CUDA_VERSION} .tar.gz"
120
131
;;
121
132
Darwin)
122
133
ARCH_FORMAT=$( [[ " $ARCH " == " arm64" ]] && echo " mac-arm64" || echo " mac-amd64" )
You can’t perform that action at this time.
0 commit comments