【问题标题】:CLI command to determine if the Mac machine is running on Apple Silicon on Intel? [duplicate]CLI 命令确定 Mac 机器是否在 Intel 上的 Apple Silicon 上运行? [复制]
【发布时间】:2021-08-31 21:20:09
【问题描述】:

在 M1 Mac Mini 上,

如果我这样做uname -i,我会得到:

uname: illegal option -- -
usage: uname [-amnprsv]

如果我这样做uname -m,我会得到:

x86_64

如果我这样做uname -a,我会得到:

Darwin bevrymemacmini.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 x86_64

只有在 uname -a 中,我才能通过 ARM64 部分获得它在 Apple Silicon 上运行的信息。

有没有更好的方法来确定我在 Mac 机器上运行哪种架构?

【问题讨论】:

标签: bash macos apple-silicon


【解决方案1】:

使用这个命令

“sysctl -a | grep machdep.cpu” 获取 cpu 上的详细转储。

“sysctl -n machdep.cpu.brand_string” 命令只会返回英特尔型号和速度。

使用 intel 从我的 mac 输出

machdep.cpu.xsave.extended_state: xxxxxxxxxxxxxxxx
machdep.cpu.xsave.extended_state1: xxxxxxxxxxxxx
machdep.cpu.thermal.ACNT_MCNT: 1
machdep.cpu.thermal.core_power_limits: 1
machdep.cpu.thermal.dynamic_acceleration: 1
machdep.cpu.thermal.energy_policy: 1
machdep.cpu.thermal.fine_grain_clock_mod: 1
machdep.cpu.thermal.hardware_feedback: 0
machdep.cpu.thermal.invariant_APIC_timer: 1
machdep.cpu.thermal.package_thermal_intr: 1
machdep.cpu.thermal.sensor: 1
machdep.cpu.thermal.thresholds: 2
machdep.cpu.mwait.extensions: 3
machdep.cpu.mwait.linesize_max: 64
machdep.cpu.mwait.linesize_min: 64
machdep.cpu.mwait.sub_Cstates: 286396448
machdep.cpu.cache.L2_associativity: 8
machdep.cpu.cache.linesize: 64
machdep.cpu.cache.size: 256
machdep.cpu.arch_perf.events: 0
machdep.cpu.arch_perf.events_number: 8
machdep.cpu.arch_perf.fixed_number: 4
machdep.cpu.arch_perf.fixed_width: 48
machdep.cpu.arch_perf.number: 8
machdep.cpu.arch_perf.version: 5
machdep.cpu.arch_perf.width: 48
machdep.cpu.address_bits.physical: 39
machdep.cpu.address_bits.virtual: 48
machdep.cpu.tsc_ccc.denominator: 2
machdep.cpu.tsc_ccc.numerator: 104
machdep.cpu.brand: 0
machdep.cpu.brand_string: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
machdep.cpu.core_count: 4
machdep.cpu.cores_per_package: 8
machdep.cpu.extfamily: 0
machdep.cpu.extfeature_bits: xxxxxxxxxxxxxxxxxx
machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI
machdep.cpu.extmodel: 7
machdep.cpu.family: 6
machdep.cpu.feature_bits: xxxxxxxxxxxxxxxxxxxxxx
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
machdep.cpu.leaf7_feature_bits: xxxxxxxxxxxxxxxxxxxxxx
machdep.cpu.leaf7_feature_bits_edx: xxxxxxxxxxxxxxx
machdep.cpu.leaf7_features: RDWRFSGS TSC_THREAD_OFFSET SGX BMI1 AVX2 FDPEO SMEP BMI2 ERMS INVPCID FPU_CSDS AVX512F AVX512DQ RDSEED ADX SMAP AVX512IFMA CLFSOPT IPT AVX512CD SHA AVX512BW AVX512VL AVX512VBMI UMIP PKU GFNI VAES VPCLMULQDQ AVX512VNNI AVX512BITALG AVX512VPOPCNTDQ RDPID SGXLC FSREPMOV MDCLEAR IBRS STIBP L1DF ACAPMSR SSBD
machdep.cpu.logical_per_package: 16
machdep.cpu.max_basic: 27
machdep.cpu.max_ext: xxxxxxxxxxxx
machdep.cpu.microcode_version: 166
machdep.cpu.model: 126
machdep.cpu.processor_flag: 7
machdep.cpu.signature: xxxxxxxxx
machdep.cpu.stepping: 5
machdep.cpu.thread_count: 8
machdep.cpu.vendor: GenuineIntel

【讨论】:

  • 也许您可以将该命令的输出添加到您的答案中,以便没有 Apple Silicon 的人可以看到会发生什么。
  • 感谢@MarkSetchell 指出,我已经更新了。
  • 谢谢。我希望更多地了解它在 Apple Silicon 上的外观,以便人们可以看到问题所提出的差异,而不是说“这是它在英特尔上的外观,不会是那样” .不过还是谢谢你。
  • 在硅片上,您会得到“Apple M1”。也许有人可以加入并添加 M1Pro 和 M1Max 的输出。
猜你喜欢
  • 2021-03-29
  • 2021-06-04
  • 2021-10-22
  • 1970-01-01
  • 2021-05-08
  • 2023-01-08
  • 2021-03-02
  • 2021-03-23
  • 2021-03-02
相关资源
最近更新 更多