samgis-lisa-on-cuda / scripts /entrypoint.sh
alessandro trinca tornidor
ci: refactor Dockerfile using nvcr.io/nvidia/pytorch:24.10-py3 as base image, use samgis-lisa==1.0.9
32656c4
raw
history blame
624 Bytes
#!/usr/bin/env bash
free -m
which nvcc || true
nvcc -V || true
which nvidia-smi || true
nvidia-smi || true
pip list
which uvicorn
ls -l ${WORKDIR}/.venv/bin/uvicorn
df -h / /home ${WORKDIR} ${XDG_CACHE_HOME}
echo "WORKDIR - /var/task"
ls -l ${WORKDIR}
CUDA_VISIBLE_DEVICES=$(nvidia-smi --query-gpu=memory.free,index --format=csv,nounits,noheader | sort -nr | head -1 | awk '{ print $NF }')
echo "calculated CUDA_VISIBLE_DEVICES env variable: ${CUDA_VISIBLE_DEVICES}."
export CUDA_VISIBLE_DEVICES
echo "running command 'uvicorn app:app --host 0.0.0.0 --port 7860'..."
uvicorn app:app --host 0.0.0.0 --port 7860
exit 0