Skip to content

Commit 62c00e0

Browse files
committed
add dimms locator info
1 parent e670453 commit 62c00e0

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

paddle/scripts/check_env.sh

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,39 @@ if [ $numa_nodes -lt $sockets ]; then
3636
fi
3737

3838
echo "-------------------------- Memory Information --------------------------"
39-
echo "DIMMs max slots : `dmidecode | grep "Bank Locator" | wc -l`"
4039
# dmidecode support start from 2.11
41-
num_dimms_installed=`dmidecode | grep "Memory Device Mapped" | wc -l`
42-
num_clock_configed=`dmidecode | grep -i "Configured Clock Speed" |grep -i "Hz" |wc -l`
40+
max_dimms=0
41+
num_dimms_installed=0
42+
for dimm_id in `dmidecode |grep Locator|sort -u | awk -F ':' '{print $2}'`; do
43+
num_refered=`dmidecode |grep -c "$dimm_id"`
44+
# the acutal dimm id should be refered only once
45+
if [ $num_refered -eq 1 ]; then
46+
num_unknown=`dmidecode | awk '/'$dimm_id'/ {s=1}; {if (s==1) {a[NR]=$0}};
47+
/Manufacturer/ {s=0; for (i in a) print a[i]; delete a}' |grep -ic unknown`
48+
if [ $num_unknown -eq 0 ]; then
49+
dimms_installed="$dimms_installed \n $dimm_id"
50+
((num_dimms_installed++))
51+
else
52+
dimms_uninstalled="$dimms_uninstalled \n $dimm_id"
53+
fi
54+
((max_dimms++))
55+
fi
56+
done
4357
echo "Installed DIMM number : $num_dimms_installed"
58+
num_dimms_mapped=`dmidecode | grep "Memory Device Mapped" | wc -l`
59+
if [ $num_dimms_installed -ne $num_dimms_mapped ]; then
60+
echo "Error: The installed DIMMs number does ont match the mapped memory device: $num_dimms_mapped"
61+
fi
62+
num_clock_configed=`dmidecode | grep -i "Configured Clock Speed" |grep -ic "Hz"`
4463
if [ $num_dimms_installed -ne $num_clock_configed ]; then
45-
echo "Error: installed DIMMs do ont match configured clocks: $num_clock_configed"
64+
echo "Error: The installed DIMMs number does ont match configured clocks: $num_clock_configed"
65+
fi
66+
echo -e "Installed DIMMs Locator: $dimms_installed"
67+
echo -e "Not installed DIMMs : $dimms_uninstalled"
68+
max_dimm_slots=`dmidecode | grep -c "Bank Locator"`
69+
echo "DIMMs max slots : $max_dimm_slots"
70+
if [ $max_dimms -ne $max_dimm_slots ]; then
71+
echo "Error: The max dimm slots do not match the max dimms: $max_dimms"
4672
fi
4773
echo "Memory Size : `free -h |grep -i mem |awk -F' ' '{print $2}'|xargs`"
4874
echo "Swap Memory Size : `free -h |grep -i swap |awk -F' ' '{print $2}'|xargs`"

0 commit comments

Comments
 (0)