diff --git a/.github/container/Dockerfile.base b/.github/container/Dockerfile.base index bb1590a63..df73b8cd1 100644 --- a/.github/container/Dockerfile.base +++ b/.github/container/Dockerfile.base @@ -50,3 +50,9 @@ ENV PATH=/opt/amazon/efa/bin:${PATH} ############################################################################### RUN ln -s /opt/nvidia/nsight-compute/*/host/target-linux-x64/nsys /usr/local/cuda/bin + +############################################################################### +## Add the systemcheck to the entrypoint. +############################################################################### + +COPY check-shm.sh /opt/nvidia/entrypoint.d/ diff --git a/.github/container/check-shm.sh b/.github/container/check-shm.sh new file mode 100755 index 000000000..c3ad7f3fc --- /dev/null +++ b/.github/container/check-shm.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +minimum_shm_size=1048576 # ~1GB in KBs + +# Grab the second line / second field of the output of `df`, +# which is the size of shm in KBs. +actual_shm_size=$(df /dev/shm | awk 'NR==2 {print $2}') + +if (( actual_shm_size < minimum_shm_size )); then + YELLOW='\033[0;33m' + NOCOLOR='\033[0m' + + echo -e "${YELLOW} + WARNING: Your shm is currenly less than 1GB. This may cause SIGBUS errors. + To avoid this problem, you can manually set the shm size in docker with: + + $ docker run ... --shm-size=1g ... + ${NOCOLOR}" +fi diff --git a/rosetta/Dockerfile.pax b/rosetta/Dockerfile.pax index 427aaaf50..6ce54773b 100644 --- a/rosetta/Dockerfile.pax +++ b/rosetta/Dockerfile.pax @@ -52,4 +52,3 @@ RUN <