Added support of Linux on Mac with ARM processors (#631)

Co-authored-by: TItus Cheung <cheungtitus@kenrui-group.com>
This commit is contained in:
cheungtitus 2024-09-09 10:09:20 +08:00 committed by GitHub
parent 6c37c5dacd
commit d00c2e75d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ scale_ram_and_cpu() {
avail_cores=`sysctl hw.ncpu | awk '/hw.ncpu:/ {print $2}'`
else
avail_gb=$(check_linux_memory)
avail_cores=`lscpu --parse=core | egrep -v ^# | sort -u | wc -l`
threads_per_core=$(lscpu | awk 'BEGIN {FS=":"} /Thread\(s\) per core/ {print $2}')
avail_cores=$((`lscpu | awk '/^CPU\(s\)/ {print $2}'`*${threads_per_core}))
fi
echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores"