Skip to content

Commit 80c0a5e

Browse files
committed
fix driver and other commands for podman
1 parent ba15963 commit 80c0a5e

File tree

1 file changed

+6
-4
lines changed
  • HeterogeneousCore/SonicTriton/scripts

1 file changed

+6
-4
lines changed

HeterogeneousCore/SonicTriton/scripts/cmsTriton

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ test_docker(){
364364

365365
test_podman(){
366366
# podman logs print to stdout
367-
${PODMAN} logs ${SERVER} | grep "$1"
367+
${PODMAN} logs ${SERVER} |& grep "$1"
368368
}
369369

370370
test_apptainer(){
@@ -522,7 +522,7 @@ driver_podman(){
522522
driver_apptainer(){
523523
D2S=${SANDBOX}/.singularity.d/env/10-docker2singularity.sh
524524
if [ -f "$D2S" ]; then
525-
source $D2S && echo $CUDA_DRIVER_VERSION
525+
source $D2S && echo "CUDA_DRIVER_VERSION=$CUDA_DRIVER_VERSION"
526526
fi
527527
}
528528

@@ -536,9 +536,10 @@ compat_apptainer(){
536536

537537
check_drivers(){
538538
# get sandbox env vars in subshell
539-
CUDA_DRIVER_VERSION=$($DRIVER_FN)
539+
eval "$($DRIVER_FN)"
540540
# copied from https://github.com/triton-inference-server/server/blob/v2.11.0/nvidia_entrypoint.sh
541-
DRIVER_VERSION=$(sed -n 's/^NVRM.*Kernel Module *\([0-9.]*\).*$/\1/p' /proc/driver/nvidia/version 2>/dev/null || true)
541+
# regex generalized to handle SUSE
542+
DRIVER_VERSION=$(sed -nr 's/^NVRM.*Kernel Module[^.]* ([0-9.]*).*$/\1/p' /proc/driver/nvidia/version 2>/dev/null || true)
542543
if [[ "${DRIVER_VERSION%%.*}" -ge "${CUDA_DRIVER_VERSION%%.*}" ]]; then
543544
return 0
544545
fi
@@ -602,6 +603,7 @@ extra_podman_hpc(){
602603
if [ "$DEVICE" == gpu ]; then
603604
EXTRA="--gpu"
604605
fi
606+
EXTRA="$EXTRA --cvmfs --log-driver=json-file"
605607
}
606608
extra_apptainer(){
607609
if [ "$DEVICE" == gpu ]; then

0 commit comments

Comments
 (0)