File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,20 @@ TENSORRT_IMAGE=${TENSORRT_IMAGE:=nvcr.io/nvidia/tensorrt:$TRITON_VERSION-py3-igp
4242UBUNTU_IMAGE=${UBUNTU_IMAGE:= ubuntu: 24.04}
4343
4444# Set CI specific parameters
45- DOCKER_GPU_ARGS=${DOCKER_GPU_ARGS:- $([[ $RUNNER_GPUS =~ ^[0-9] ]] && eval $NV_DOCKER_ARGS || echo " --gpus $NVIDIA_VISIBLE_DEVICES " )}
45+ define_docker_gpu_args () {
46+ # If RUNNER_GPUS is set and starts with a digit, use NV_DOCKER_ARGS
47+ if [[ -v RUNNER_GPUS && $RUNNER_GPUS =~ ^[0-9] ]]; then
48+ eval echo $NV_DOCKER_ARGS
49+ # Handle special values for NVIDIA_VISIBLE_DEVICES
50+ elif [[ " $NVIDIA_VISIBLE_DEVICES " == " all" ]]; then
51+ echo " --gpus all"
52+ elif [[ " $NVIDIA_VISIBLE_DEVICES " == " none" ]]; then
53+ echo " "
54+ else
55+ echo " --gpus '\" device=$NVIDIA_VISIBLE_DEVICES \" '"
56+ fi
57+ }
58+ DOCKER_GPU_ARGS=${DOCKER_GPU_ARGS:- $(compute_docker_gpu_args)}
4659
4760# ###########################################################################
4861# Check if Docker volume exists
Original file line number Diff line number Diff line change @@ -80,7 +80,23 @@ PROJECT_NAME=${PROJECT_NAME:=tritonserver}
8080log_message.status " define: Docker engine parameters"
8181DOCKER_VOLUME=${DOCKER_VOLUME:= volume.gen_qa_model_repository.${CI_JOB_ID} }
8282DOCKER_VOLUME_CONTAINER=${DOCKER_VOLUME} .gen_qa_model_repository.${CI_JOB_ID}
83- DOCKER_GPU_ARGS=${DOCKER_GPU_ARGS:- $([[ -v RUNNER_GPUS && $RUNNER_GPUS =~ ^[0-9] ]] && eval $NV_DOCKER_ARGS || echo " --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=$NVIDIA_VISIBLE_DEVICES " )}
83+
84+ # Compute Docker GPU arguments based on environment
85+ define_docker_gpu_args () {
86+ # If RUNNER_GPUS is set and starts with a digit, use NV_DOCKER_ARGS
87+ if [[ -v RUNNER_GPUS && $RUNNER_GPUS =~ ^[0-9] ]]; then
88+ eval echo $NV_DOCKER_ARGS
89+ # Handle special values for NVIDIA_VISIBLE_DEVICES
90+ elif [[ " $NVIDIA_VISIBLE_DEVICES " == " all" ]]; then
91+ echo " --gpus all"
92+ elif [[ " $NVIDIA_VISIBLE_DEVICES " == " none" ]]; then
93+ echo " "
94+ # Default: use device parameter with proper quoting
95+ else
96+ echo " --gpus '\" device=$NVIDIA_VISIBLE_DEVICES \" '"
97+ fi
98+ }
99+ DOCKER_GPU_ARGS=${DOCKER_GPU_ARGS:- $(compute_docker_gpu_args)}
84100
85101function define_model_output_directories() {
86102 log_message.status " define: model output directories"
You can’t perform that action at this time.
0 commit comments