Skip to content

Commit

Permalink
Merge pull request #491 from infosiftr/avx-warning
Browse files Browse the repository at this point in the history
Add a warning for non-AVX (amd64) systems
  • Loading branch information
yosifkit committed Aug 3, 2021
2 parents c0c7aa3 + c1f08e8 commit 43286fc
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 4.0/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 4.2/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 4.4-rc/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 4.4/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 5.0/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ if [[ "$originalArgOne" == mongo* ]] && [ "$(id -u)" = '0' ]; then
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if dpkgArch="$(dpkg --print-architecture)" && [ "$dpkgArch" = 'amd64' ] && ! grep -qE '^flags.* avx( .*|$)' /proc/cpuinfo; then
# https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
{
echo
echo 'WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!'
echo ' see https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2'
echo ' see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814'
echo
} >&2
fi

# you should use numactl to start your mongod instances, including the config servers, mongos instances, and any clients.
# https://docs.mongodb.com/manual/administration/production-notes/#configuring-numa-on-linux
if [[ "$originalArgOne" == mongo* ]]; then
Expand Down

0 comments on commit 43286fc

Please sign in to comment.