File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,15 @@ mkdir -p ${TARBALL_TMP_BUILD_STEP_DIR}
223
223
BUILD_STEP_ARGS+=(" --save" " ${TARBALL_TMP_BUILD_STEP_DIR} " )
224
224
BUILD_STEP_ARGS+=(" --storage" " ${STORAGE} " )
225
225
# add options required to handle NVIDIA support
226
- BUILD_STEP_ARGS+=(" --nvidia" " all" )
226
+ if command_exists " nvidia-smi" ; then
227
+ echo " Command 'nvidia-smi' found, using available GPU"
228
+ BUILD_STEP_ARGS+=(" --nvidia" " all" )
229
+ else
230
+ echo " No 'nvidia-smi' found, no available GPU but allowing overriding this check"
231
+ BUILD_STEP_ARGS+=(" --nvidia" " install" )
232
+ fi
233
+ # Retain location for host injections so we don't reinstall CUDA
234
+ # (Always need to run the driver installation as available driver may change)
227
235
if [[ ! -z ${SHARED_FS_PATH} ]]; then
228
236
BUILD_STEP_ARGS+=(" --host-injections" " ${SHARED_FS_PATH} /host-injections" )
229
237
fi
Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ function create_directory_structure() {
78
78
return $return_code
79
79
}
80
80
81
+ # Function to check if a command exists
82
+ function command_exists() {
83
+ command -v " $1 " > /dev/null 2>&1
84
+ }
85
+
81
86
function get_path_for_tool {
82
87
tool_name=$1
83
88
tool_envvar_name=$2
You can’t perform that action at this time.
0 commit comments