Skip to content

Commit

Permalink
fall back to 'CPU implementer' field from /proc/cpuinfo if 'Vendor ID…
Browse files Browse the repository at this point in the history
…' field is not available
  • Loading branch information
boegel committed Jan 10, 2025
1 parent 5bad2d9 commit e53ac16
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions init/eessi_archdetect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,17 @@ cpupath(){
update_arch_specs "$base_dir/arch_specs/${spec_file}"

# Identify the host CPU vendor
local cpu_vendor_tag="vendor[ _]id"
local cpu_vendor=$(get_cpuinfo "$cpu_vendor_tag")
local cpu_vendor=$(get_cpuinfo "vendor[ _]id")
if [ "${cpu_vendor}" == "" ]; then
cpu_vendor=$(get_cpuinfo "cpu[ _]implementer")
fi
log "DEBUG" "cpupath: CPU vendor of host system: '$cpu_vendor'"

# Identify the host CPU flags or features
local cpu_flag_tag='flags'
# cpuinfo systems print different line identifiers, eg features, instead of flags
[ "${cpu_vendor}" == "ARM" ] && cpu_flag_tag='flags'
[ "${machine_type}" == "aarch64" ] && [ "${cpu_vendor}x" == "x" ] && cpu_flag_tag='features'
[ "${machine_type}" == "aarch64" ] && [ "${cpu_flag_tag}" == "flags" ] && cpu_flag_tag='features'
[ "${machine_type}" == "ppc64le" ] && cpu_flag_tag='cpu'

local cpu_flags=$(get_cpuinfo "$cpu_flag_tag")
Expand Down

0 comments on commit e53ac16

Please sign in to comment.