@@ -173,24 +173,34 @@ build_from_source() {
173
173
build=" build"
174
174
fi
175
175
176
- # Check if GPU support is disabled.
177
- if [ " ${FFI_USE_GPU} " == " 0" ]; then
178
- gpu_flags=" "
179
- elif [ " ${FFI_USE_CUDA_SUPRASEAL} " == " 1" ]; then
180
- # If SupraSeal is enabled, just use the `cuda-supraseal` eature and
176
+ # Check for specified GPU support.
177
+ if [ " ${FFI_USE_CUDA_SUPRASEAL} " == " 1" ]; then
178
+ # If SupraSeal is enabled, just use the `cuda-supraseal` feature and
181
179
# nothing else GPU related.
182
180
gpu_flags=" ,cuda-supraseal"
181
+
182
+ if [ ! " $( command -v nvcc) " ]; then
183
+ echo " WARNING: Cannot find nvcc for CUDA support."
184
+ echo " WARNING: For CUDA support, please ensure that the CUDA toolkit is properly installed."
185
+ echo " WARNING: After installation, nvcc must be in the system path."
186
+ echo " "
187
+ echo " WARNING: Defaulting to OpenCL GPU support(!!!)"
188
+ gpu_flags=" ,opencl"
189
+ fi
183
190
else
184
- # If GPUs are enabled and SupraSeal is not, default to CUDA support
185
- # where possible.
186
- # First ensure that nvcc (as part of the CUDA toolkit) is available --
187
- # if it's not warn that we are defaulting GPU to OpenCL instead.
188
- gpu_flags=" ,cuda"
189
-
190
- # Unless OpenCL support is specified or we're building on Darwin.
191
- if [ " ${FFI_USE_OPENCL} " == " 1" ] || [ " $( uname -s) " = " Darwin" ]; then
191
+ # Check if GPU usage is to be disabled.
192
+ if [ " ${FFI_USE_GPU} " == " 0" ]; then
193
+ gpu_flags=" "
194
+ # Check if OpenCL support is specified or we're building on Darwin.
195
+ elif [ " ${FFI_USE_OPENCL} " == " 1" ] || [ " $( uname -s) " = " Darwin" ]; then
192
196
gpu_flags=" ,opencl"
193
197
else
198
+ # If GPUs are enabled and SupraSeal is not, default to CUDA support
199
+ # where possible.
200
+ # First ensure that nvcc (as part of the CUDA toolkit) is available --
201
+ # if it's not warn that we are defaulting GPU to OpenCL instead.
202
+ gpu_flags=" ,cuda"
203
+
194
204
if [ ! " $( command -v nvcc) " ]; then
195
205
echo " WARNING: Cannot find nvcc for CUDA support."
196
206
echo " WARNING: For CUDA support, please ensure that the CUDA toolkit is properly installed."
0 commit comments