Skip to content

Commit

Permalink
Added warning for shm < 1GB (#247)
Browse files Browse the repository at this point in the history
Fixes #183

---------

Co-authored-by: Yu-Hang Maxin Tang <[email protected]>
  • Loading branch information
chaserileyroberts and yhtang authored Oct 2, 2023
1 parent 6a477a7 commit b179392
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/container/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -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/
19 changes: 19 additions & 0 deletions .github/container/check-shm.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion rosetta/Dockerfile.pax
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ RUN <<EOF
pip install -e '/opt/rosetta[test,lint]'
rm -rf ~/.cache/pip/
EOF

0 comments on commit b179392

Please sign in to comment.