You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an admin, I want the distro_info.sh script to accurately report the frequencies and # of all CPU cores, including both E and P cores.
Game
All
Linux distro
Ubuntu 22.04
Command
command: details
Further information
The script distro_info.sh currently has limitations in accurately reporting CPU information for systems with hybrid architectures that include both Efficiency (E-cores) and Performance (P-cores) cores and systems that support Multithreading.
The bugs can be found in the output of ./gameserver details.
CPU Frequency Reporting:
The script uses a method to fetch the CPU frequency that does not account for the differing frequencies of E and P cores. It only captures the frequency of a single core, which can lead to misleading information about the system's capabilities: info_distro.sh#L142
cpufreqency="$(awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]//;s/[ \t]$//')" # e.g 2394.503
This should be updated to reflect a more accurate representation of the system's CPU frequencies, especially for hybrid architectures.
A possible solution would be to list the number of cores running at different frequencies:
declare -A freq_count
# Loop through each core and collect frequencieswhile IFS=: read -r label cpu_id;do
cpu_freq=$(awk -v id="$cpu_id"'$1 == "processor" {p=$3} $1 == "cpu" && $2 == "MHz" && p == id {print $4; exit}' /proc/cpuinfo)((freq_count[$cpu_freq]++))done<<(awk -F: '/processor/ {print $1 ":" $2}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')# Sort by frequencyforfreqin"${!freq_count[@]}";doecho"$freq${freq_count[$freq]}"done| sort -rn -k1,1 | awk '{print $2"x " $1 " MHz"}'| paste -sd, - | sed 's/,/, /g'
Or use the average frequency of all cores:
# Initialize sum of frequencies and core count
total_freq=0
core_count=0
# Loop through each coreforcpu_idin$(awk -F: '/processor/ {print $2}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//');do# Extract the frequency of the current core
cpu_freq=$(awk -v id="$cpu_id"'$1 == "processor" {p=$3} $1 == "cpu" && $2 == "MHz" && p == id {print $4; exit}' /proc/cpuinfo)# Add the frequency to the total
total_freq=$(echo "$total_freq + $cpu_freq"| bc)# Increment the core count
core_count=$((core_count +1))done# Calculate the average frequencyif [ $core_count-gt 0 ];then
avg_freq=$(echo "scale=2; $total_freq / $core_count"| bc)echo"Average CPU Frequency: $avg_freq MHz"fi
CPU Core Count Reporting
Additionally, the script inaccurately reports the total number of CPU cores in systems with hybrid architectures. For example, on an Intel i7-13700K, which has 16 physical cores (8 E-cores and 8 P-cores), the script reports a total of 24 cores. This discrepancy arises from the following line: info_distro.sh#141
cpucores="$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)"
This is likely to be an issue of how logical cores are counted versus physical cores, especially in the context of Intel's Thread Director technology, which can present more logical processors to the operating system than the physical core count.
The solution is to use the value of cpu cores listed in /proc/cpuinfo:
User story
As an admin, I want the distro_info.sh script to accurately report the frequencies and # of all CPU cores, including both E and P cores.
Game
All
Linux distro
Ubuntu 22.04
Command
command: details
Further information
The script
distro_info.sh
currently has limitations in accurately reporting CPU information for systems with hybrid architectures that include both Efficiency (E-cores) and Performance (P-cores) cores and systems that support Multithreading.The bugs can be found in the output of
./gameserver details
.CPU Frequency Reporting:
The script uses a method to fetch the CPU frequency that does not account for the differing frequencies of E and P cores. It only captures the frequency of a single core, which can lead to misleading information about the system's capabilities: info_distro.sh#L142
This should be updated to reflect a more accurate representation of the system's CPU frequencies, especially for hybrid architectures.
CPU Core Count Reporting
Additionally, the script inaccurately reports the total number of CPU cores in systems with hybrid architectures. For example, on an Intel i7-13700K, which has 16 physical cores (8 E-cores and 8 P-cores), the script reports a total of 24 cores. This discrepancy arises from the following line: info_distro.sh#141
This is likely to be an issue of how logical cores are counted versus physical cores, especially in the context of Intel's Thread Director technology, which can present more logical processors to the operating system than the physical core count.
cpu cores
listed in/proc/cpuinfo
:cpucores="$(awk -F': ' '/cpu cores/ {print $2; exit}' /proc/cpuinfo)"
Relevant log output
No response
Steps to reproduce
These bugs might only arise on bare metal servers
./gameserver details
The text was updated successfully, but these errors were encountered: