Coder Social home page Coder Social logo

cpuid's Introduction

cpuid

Package cpuid provides information about the CPU running the current program.

CPU features are detected on startup, and kept for fast access through the life of the application. Currently x86 / x64 (AMD64/i386) and ARM (ARM64) is supported, and no external C (cgo) code is used, which should make the library very easy to use.

You can access the CPU information by accessing the shared CPU variable of the cpuid library.

Package home: https://github.com/klauspost/cpuid

PkgGoDev Go

installing

go get -u github.com/klauspost/cpuid/v2 using modules. Drop v2 for others.

Installing binary:

go install github.com/klauspost/cpuid/v2/cmd/cpuid@latest

Or download binaries from release page: https://github.com/klauspost/cpuid/releases

Homebrew

For macOS/Linux users, you can install via brew

$ brew install cpuid

example

package main

import (
	"fmt"
	"strings"

	. "github.com/klauspost/cpuid/v2"
)

func main() {
	// Print basic CPU information:
	fmt.Println("Name:", CPU.BrandName)
	fmt.Println("PhysicalCores:", CPU.PhysicalCores)
	fmt.Println("ThreadsPerCore:", CPU.ThreadsPerCore)
	fmt.Println("LogicalCores:", CPU.LogicalCores)
	fmt.Println("Family", CPU.Family, "Model:", CPU.Model, "Vendor ID:", CPU.VendorID)
	fmt.Println("Features:", strings.Join(CPU.FeatureSet(), ","))
	fmt.Println("Cacheline bytes:", CPU.CacheLine)
	fmt.Println("L1 Data Cache:", CPU.Cache.L1D, "bytes")
	fmt.Println("L1 Instruction Cache:", CPU.Cache.L1I, "bytes")
	fmt.Println("L2 Cache:", CPU.Cache.L2, "bytes")
	fmt.Println("L3 Cache:", CPU.Cache.L3, "bytes")
	fmt.Println("Frequency", CPU.Hz, "hz")

	// Test if we have these specific features:
	if CPU.Supports(SSE, SSE2) {
		fmt.Println("We have Streaming SIMD 2 Extensions")
	}
}

Sample output:

>go run main.go
Name: AMD Ryzen 9 3950X 16-Core Processor
PhysicalCores: 16
ThreadsPerCore: 2
LogicalCores: 32
Family 23 Model: 113 Vendor ID: AMD
Features: ADX,AESNI,AVX,AVX2,BMI1,BMI2,CLMUL,CMOV,CX16,F16C,FMA3,HTT,HYPERVISOR,LZCNT,MMX,MMXEXT,NX,POPCNT,RDRAND,RDSEED,RDTSCP,SHA,SSE,SSE2,SSE3,SSE4,SSE42,SSE4A,SSSE3
Cacheline bytes: 64
L1 Data Cache: 32768 bytes
L1 Instruction Cache: 32768 bytes
L2 Cache: 524288 bytes
L3 Cache: 16777216 bytes
Frequency 0 hz
We have Streaming SIMD 2 Extensions

usage

The cpuid.CPU provides access to CPU features. Use cpuid.CPU.Supports() to check for CPU features. A faster cpuid.CPU.Has() is provided which will usually be inlined by the gc compiler.

To test a larger number of features, they can be combined using f := CombineFeatures(CMOV, CMPXCHG8, X87, FXSR, MMX, SYSCALL, SSE, SSE2), etc. This can be using with cpuid.CPU.HasAll(f) to quickly test if all features are supported.

Note that for some cpu/os combinations some features will not be detected. amd64 has rather good support and should work reliably on all platforms.

Note that hypervisors may not pass through all CPU features through to the guest OS, so even if your host supports a feature it may not be visible on guests.

arm64 feature detection

Not all operating systems provide ARM features directly and there is no safe way to do so for the rest.

Currently arm64/linux and arm64/freebsd should be quite reliable. arm64/darwin adds features expected from the M1 processor, but a lot remains undetected.

A DetectARM() can be used if you are able to control your deployment, it will detect CPU features, but may crash if the OS doesn't intercept the calls. A -cpu.arm flag for detecting unsafe ARM features can be added. See below.

Note that currently only features are detected on ARM, no additional information is currently available.

flags

It is possible to add flags that affects cpu detection.

For this the Flags() command is provided.

This must be called before flag.Parse() AND after the flags have been parsed Detect() must be called.

This means that any detection used in init() functions will not contain these flags.

Example:

package main

import (
	"flag"
	"fmt"
	"strings"

	"github.com/klauspost/cpuid/v2"
)

func main() {
	cpuid.Flags()
	flag.Parse()
	cpuid.Detect()

	// Test if we have these specific features:
	if cpuid.CPU.Supports(cpuid.SSE, cpuid.SSE2) {
		fmt.Println("We have Streaming SIMD 2 Extensions")
	}
}

commandline

Download as binary from: https://github.com/klauspost/cpuid/releases

Install from source:

go install github.com/klauspost/cpuid/v2/cmd/cpuid@latest

Example

λ cpuid
Name: AMD Ryzen 9 3950X 16-Core Processor
Vendor String: AuthenticAMD
Vendor ID: AMD
PhysicalCores: 16
Threads Per Core: 2
Logical Cores: 32
CPU Family 23 Model: 113
Features: ADX,AESNI,AVX,AVX2,BMI1,BMI2,CLMUL,CLZERO,CMOV,CMPXCHG8,CPBOOST,CX16,F16C,FMA3,FXSR,FXSROPT,HTT,HYPERVISOR,LAHF,LZCNT,MCAOVERFLOW,MMX,MMXEXT,MOVBE,NX,OSXSAVE,POPCNT,RDRAND,RDSEED,RDTSCP,SCE,SHA,SSE,SSE2,SSE3,SSE4,SSE42,SSE4A,SSSE3,SUCCOR,X87,XSAVE
Microarchitecture level: 3
Cacheline bytes: 64
L1 Instruction Cache: 32768 bytes
L1 Data Cache: 32768 bytes
L2 Cache: 524288 bytes
L3 Cache: 16777216 bytes

JSON Output:

λ cpuid --json
{
  "BrandName": "AMD Ryzen 9 3950X 16-Core Processor",
  "VendorID": 2,
  "VendorString": "AuthenticAMD",
  "PhysicalCores": 16,
  "ThreadsPerCore": 2,
  "LogicalCores": 32,
  "Family": 23,
  "Model": 113,
  "CacheLine": 64,
  "Hz": 0,
  "BoostFreq": 0,
  "Cache": {
    "L1I": 32768,
    "L1D": 32768,
    "L2": 524288,
    "L3": 16777216
  },
  "SGX": {
    "Available": false,
    "LaunchControl": false,
    "SGX1Supported": false,
    "SGX2Supported": false,
    "MaxEnclaveSizeNot64": 0,
    "MaxEnclaveSize64": 0,
    "EPCSections": null
  },
  "Features": [
    "ADX",
    "AESNI",
    "AVX",
    "AVX2",
    "BMI1",
    "BMI2",
    "CLMUL",
    "CLZERO",
    "CMOV",
    "CMPXCHG8",
    "CPBOOST",
    "CX16",
    "F16C",
    "FMA3",
    "FXSR",
    "FXSROPT",
    "HTT",
    "HYPERVISOR",
    "LAHF",
    "LZCNT",
    "MCAOVERFLOW",
    "MMX",
    "MMXEXT",
    "MOVBE",
    "NX",
    "OSXSAVE",
    "POPCNT",
    "RDRAND",
    "RDSEED",
    "RDTSCP",
    "SCE",
    "SHA",
    "SSE",
    "SSE2",
    "SSE3",
    "SSE4",
    "SSE42",
    "SSE4A",
    "SSSE3",
    "SUCCOR",
    "X87",
    "XSAVE"
  ],
  "X64Level": 3
}

Check CPU microarch level

λ cpuid --check-level=3
2022/03/18 17:04:40 AMD Ryzen 9 3950X 16-Core Processor
2022/03/18 17:04:40 Microarchitecture level 3 is supported. Max level is 3.
Exit Code 0

λ cpuid --check-level=4
2022/03/18 17:06:18 AMD Ryzen 9 3950X 16-Core Processor
2022/03/18 17:06:18 Microarchitecture level 4 not supported. Max level is 3.
Exit Code 1

Available flags

x86 & amd64

Feature Flag Description
ADX Intel ADX (Multi-Precision Add-Carry Instruction Extensions)
AESNI Advanced Encryption Standard New Instructions
AMD3DNOW AMD 3DNOW
AMD3DNOWEXT AMD 3DNowExt
AMXBF16 Tile computational operations on BFLOAT16 numbers
AMXINT8 Tile computational operations on 8-bit integers
AMXFP16 Tile computational operations on FP16 numbers
AMXTILE Tile architecture
APX_F Intel APX
AVX AVX functions
AVX10 If set the Intel AVX10 Converged Vector ISA is supported
AVX10_128 If set indicates that AVX10 128-bit vector support is present
AVX10_256 If set indicates that AVX10 256-bit vector support is present
AVX10_512 If set indicates that AVX10 512-bit vector support is present
AVX2 AVX2 functions
AVX512BF16 AVX-512 BFLOAT16 Instructions
AVX512BITALG AVX-512 Bit Algorithms
AVX512BW AVX-512 Byte and Word Instructions
AVX512CD AVX-512 Conflict Detection Instructions
AVX512DQ AVX-512 Doubleword and Quadword Instructions
AVX512ER AVX-512 Exponential and Reciprocal Instructions
AVX512F AVX-512 Foundation
AVX512FP16 AVX-512 FP16 Instructions
AVX512IFMA AVX-512 Integer Fused Multiply-Add Instructions
AVX512PF AVX-512 Prefetch Instructions
AVX512VBMI AVX-512 Vector Bit Manipulation Instructions
AVX512VBMI2 AVX-512 Vector Bit Manipulation Instructions, Version 2
AVX512VL AVX-512 Vector Length Extensions
AVX512VNNI AVX-512 Vector Neural Network Instructions
AVX512VP2INTERSECT AVX-512 Intersect for D/Q
AVX512VPOPCNTDQ AVX-512 Vector Population Count Doubleword and Quadword
AVXIFMA AVX-IFMA instructions
AVXNECONVERT AVX-NE-CONVERT instructions
AVXSLOW Indicates the CPU performs 2 128 bit operations instead of one
AVXVNNI AVX (VEX encoded) VNNI neural network instructions
AVXVNNIINT8 AVX-VNNI-INT8 instructions
BHI_CTRL Branch History Injection and Intra-mode Branch Target Injection / CVE-2022-0001, CVE-2022-0002 / INTEL-SA-00598
BMI1 Bit Manipulation Instruction Set 1
BMI2 Bit Manipulation Instruction Set 2
CETIBT Intel CET Indirect Branch Tracking
CETSS Intel CET Shadow Stack
CLDEMOTE Cache Line Demote
CLMUL Carry-less Multiplication
CLZERO CLZERO instruction supported
CMOV i686 CMOV
CMPCCXADD CMPCCXADD instructions
CMPSB_SCADBS_SHORT Fast short CMPSB and SCASB
CMPXCHG8 CMPXCHG8 instruction
CPBOOST Core Performance Boost
CPPC AMD: Collaborative Processor Performance Control
CX16 CMPXCHG16B Instruction
EFER_LMSLE_UNS AMD: =Core::X86::Msr::EFER[LMSLE] is not supported, and MBZ
ENQCMD Enqueue Command
ERMS Enhanced REP MOVSB/STOSB
F16C Half-precision floating-point conversion
FLUSH_L1D Flush L1D cache
FMA3 Intel FMA 3. Does not imply AVX.
FMA4 Bulldozer FMA4 functions
FP128 AMD: When set, the internal FP/SIMD execution datapath is 128-bits wide
FP256 AMD: When set, the internal FP/SIMD execution datapath is 256-bits wide
FSRM Fast Short Rep Mov
FXSR FXSAVE, FXRESTOR instructions, CR4 bit 9
FXSROPT FXSAVE/FXRSTOR optimizations
GFNI Galois Field New Instructions. May require other features (AVX, AVX512VL,AVX512F) based on usage.
HLE Hardware Lock Elision
HRESET If set CPU supports history reset and the IA32_HRESET_ENABLE MSR
HTT Hyperthreading (enabled)
HWA Hardware assert supported. Indicates support for MSRC001_10
HYBRID_CPU This part has CPUs of more than one type.
HYPERVISOR This bit has been reserved by Intel & AMD for use by hypervisors
IA32_ARCH_CAP IA32_ARCH_CAPABILITIES MSR (Intel)
IA32_CORE_CAP IA32_CORE_CAPABILITIES MSR
IBPB Indirect Branch Restricted Speculation (IBRS) and Indirect Branch Predictor Barrier (IBPB)
IBRS AMD: Indirect Branch Restricted Speculation
IBRS_PREFERRED AMD: IBRS is preferred over software solution
IBRS_PROVIDES_SMP AMD: IBRS provides Same Mode Protection
IBS Instruction Based Sampling (AMD)
IBSBRNTRGT Instruction Based Sampling Feature (AMD)
IBSFETCHSAM Instruction Based Sampling Feature (AMD)
IBSFFV Instruction Based Sampling Feature (AMD)
IBSOPCNT Instruction Based Sampling Feature (AMD)
IBSOPCNTEXT Instruction Based Sampling Feature (AMD)
IBSOPSAM Instruction Based Sampling Feature (AMD)
IBSRDWROPCNT Instruction Based Sampling Feature (AMD)
IBSRIPINVALIDCHK Instruction Based Sampling Feature (AMD)
IBS_FETCH_CTLX AMD: IBS fetch control extended MSR supported
IBS_OPDATA4 AMD: IBS op data 4 MSR supported
IBS_OPFUSE AMD: Indicates support for IbsOpFuse
IBS_PREVENTHOST Disallowing IBS use by the host supported
IBS_ZEN4 Fetch and Op IBS support IBS extensions added with Zen4
IDPRED_CTRL IPRED_DIS
INT_WBINVD WBINVD/WBNOINVD are interruptible.
INVLPGB NVLPGB and TLBSYNC instruction supported
KEYLOCKER Key locker
KEYLOCKERW Key locker wide
LAHF LAHF/SAHF in long mode
LAM If set, CPU supports Linear Address Masking
LBRVIRT LBR virtualization
LZCNT LZCNT instruction
MCAOVERFLOW MCA overflow recovery support.
MCDT_NO Processor do not exhibit MXCSR Configuration Dependent Timing behavior and do not need to mitigate it.
MCOMMIT MCOMMIT instruction supported
MD_CLEAR VERW clears CPU buffers
MMX standard MMX
MMXEXT SSE integer functions or AMD MMX ext
MOVBE MOVBE instruction (big-endian)
MOVDIR64B Move 64 Bytes as Direct Store
MOVDIRI Move Doubleword as Direct Store
MOVSB_ZL Fast Zero-Length MOVSB
MPX Intel MPX (Memory Protection Extensions)
MOVU MOVU SSE instructions are more efficient and should be preferred to SSE MOVL/MOVH. MOVUPS is more efficient than MOVLPS/MOVHPS. MOVUPD is more efficient than MOVLPD/MOVHPD
MSRIRC Instruction Retired Counter MSR available
MSRLIST Read/Write List of Model Specific Registers
MSR_PAGEFLUSH Page Flush MSR available
NRIPS Indicates support for NRIP save on VMEXIT
NX NX (No-Execute) bit
OSXSAVE XSAVE enabled by OS
PCONFIG PCONFIG for Intel Multi-Key Total Memory Encryption
POPCNT POPCNT instruction
PPIN AMD: Protected Processor Inventory Number support. Indicates that Protected Processor Inventory Number (PPIN) capability can be enabled
PREFETCHI PREFETCHIT0/1 instructions
PSFD Predictive Store Forward Disable
RDPRU RDPRU instruction supported
RDRAND RDRAND instruction is available
RDSEED RDSEED instruction is available
RDTSCP RDTSCP Instruction
RRSBA_CTRL Restricted RSB Alternate
RTM Restricted Transactional Memory
RTM_ALWAYS_ABORT Indicates that the loaded microcode is forcing RTM abort.
SERIALIZE Serialize Instruction Execution
SEV AMD Secure Encrypted Virtualization supported
SEV_64BIT AMD SEV guest execution only allowed from a 64-bit host
SEV_ALTERNATIVE AMD SEV Alternate Injection supported
SEV_DEBUGSWAP Full debug state swap supported for SEV-ES guests
SEV_ES AMD SEV Encrypted State supported
SEV_RESTRICTED AMD SEV Restricted Injection supported
SEV_SNP AMD SEV Secure Nested Paging supported
SGX Software Guard Extensions
SGXLC Software Guard Extensions Launch Control
SHA Intel SHA Extensions
SME AMD Secure Memory Encryption supported
SME_COHERENT AMD Hardware cache coherency across encryption domains enforced
SPEC_CTRL_SSBD Speculative Store Bypass Disable
SRBDS_CTRL SRBDS mitigation MSR available
SSE SSE functions
SSE2 P4 SSE functions
SSE3 Prescott SSE3 functions
SSE4 Penryn SSE4.1 functions
SSE42 Nehalem SSE4.2 functions
SSE4A AMD Barcelona microarchitecture SSE4a instructions
SSSE3 Conroe SSSE3 functions
STIBP Single Thread Indirect Branch Predictors
STIBP_ALWAYSON AMD: Single Thread Indirect Branch Prediction Mode has Enhanced Performance and may be left Always On
STOSB_SHORT Fast short STOSB
SUCCOR Software uncorrectable error containment and recovery capability.
SVM AMD Secure Virtual Machine
SVMDA Indicates support for the SVM decode assists.
SVMFBASID SVM, Indicates that TLB flush events, including CR3 writes and CR4.PGE toggles, flush only the current ASID's TLB entries. Also indicates support for the extended VMCBTLB_Control
SVML AMD SVM lock. Indicates support for SVM-Lock.
SVMNP AMD SVM nested paging
SVMPF SVM pause intercept filter. Indicates support for the pause intercept filter
SVMPFT SVM PAUSE filter threshold. Indicates support for the PAUSE filter cycle count threshold
SYSCALL System-Call Extension (SCE): SYSCALL and SYSRET instructions.
SYSEE SYSENTER and SYSEXIT instructions
TBM AMD Trailing Bit Manipulation
TDX_GUEST Intel Trust Domain Extensions Guest
TLB_FLUSH_NESTED AMD: Flushing includes all the nested translations for guest translations
TME Intel Total Memory Encryption. The following MSRs are supported: IA32_TME_CAPABILITY, IA32_TME_ACTIVATE, IA32_TME_EXCLUDE_MASK, and IA32_TME_EXCLUDE_BASE.
TOPEXT TopologyExtensions: topology extensions support. Indicates support for CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX.
TSCRATEMSR MSR based TSC rate control. Indicates support for MSR TSC ratio MSRC000_0104
TSXLDTRK Intel TSX Suspend Load Address Tracking
VAES Vector AES. AVX(512) versions requires additional checks.
VMCBCLEAN VMCB clean bits. Indicates support for VMCB clean bits.
VMPL AMD VM Permission Levels supported
VMSA_REGPROT AMD VMSA Register Protection supported
VMX Virtual Machine Extensions
VPCLMULQDQ Carry-Less Multiplication Quadword. Requires AVX for 3 register versions.
VTE AMD Virtual Transparent Encryption supported
WAITPKG TPAUSE, UMONITOR, UMWAIT
WBNOINVD Write Back and Do Not Invalidate Cache
WRMSRNS Non-Serializing Write to Model Specific Register
X87 FPU
XGETBV1 Supports XGETBV with ECX = 1
XOP Bulldozer XOP functions
XSAVE XSAVE, XRESTOR, XSETBV, XGETBV
XSAVEC Supports XSAVEC and the compacted form of XRSTOR.
XSAVEOPT XSAVEOPT available
XSAVES Supports XSAVES/XRSTORS and IA32_XSS

ARM features:

Feature Flag Description
AESARM AES instructions
ARMCPUID Some CPU ID registers readable at user-level
ASIMD Advanced SIMD
ASIMDDP SIMD Dot Product
ASIMDHP Advanced SIMD half-precision floating point
ASIMDRDM Rounding Double Multiply Accumulate/Subtract (SQRDMLAH/SQRDMLSH)
ATOMICS Large System Extensions (LSE)
CRC32 CRC32/CRC32C instructions
DCPOP Data cache clean to Point of Persistence (DC CVAP)
EVTSTRM Generic timer
FCMA Floatin point complex number addition and multiplication
FP Single-precision and double-precision floating point
FPHP Half-precision floating point
GPA Generic Pointer Authentication
JSCVT Javascript-style double->int convert (FJCVTZS)
LRCPC Weaker release consistency (LDAPR, etc)
PMULL Polynomial Multiply instructions (PMULL/PMULL2)
SHA1 SHA-1 instructions (SHA1C, etc)
SHA2 SHA-2 instructions (SHA256H, etc)
SHA3 SHA-3 instructions (EOR3, RAXI, XAR, BCAX)
SHA512 SHA512 instructions
SM3 SM3 instructions
SM4 SM4 instructions
SVE Scalable Vector Extension

license

This code is published under an MIT license. See LICENSE file for more information.

cpuid's People

Contributors

abourget avatar askervin avatar batmac avatar chenrui333 avatar ebfe avatar fidencio avatar fmuyassarov avatar fpelliccioni avatar fwessels avatar guilhermecaruso avatar hugelgupf avatar hygonsoc avatar ibrahimfadel avatar ipuustin avatar ironiridis avatar jkawamoto avatar klauspost avatar lencerf avatar mcastelino avatar mostynb avatar mythi avatar seebs avatar tklauser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpuid's Issues

Package does not build with gccgo

gccgo toolchain does not support Plan 9 assembly syntax; instead it expects GNU as syntax. When trying to build a program that references cpuid package, I get the following errors:

$ go build -compiler gccgo
# github.com/klauspost/cpuid
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s: Assembler messages:
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:4: Error: no such instruction: `text ·asmCpuid(SB),7,$0'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:5: Error: junk `(FP)' after expression
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:5: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:7: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:8: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:9: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:10: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:16: Error: no such instruction: `text ·asmCpuidex(SB),7,$0'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:17: Error: junk `(FP)' after expression
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:17: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:18: Error: junk `(FP)' after expression
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:18: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:20: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:21: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:22: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:23: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:27: Error: no such instruction: `text ·asmXgetbv(SB),7,$0'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:28: Error: junk `(FP)' after expression
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:28: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:29: Error: no such instruction: `byte $0x0f'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:29: Error: no such instruction: `byte $0x01'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:29: Error: no such instruction: `byte $0xd0//XGETBV'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:30: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:31: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:35: Error: no such instruction: `text ·asmRdtscpAsm(SB),7,$0'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:36: Error: no such instruction: `byte $0x0F'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:36: Error: no such instruction: `byte $0x01'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:36: Error: no such instruction: `byte $0xF9//RDTSCP'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:37: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:38: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:39: Error: too many memory references for `mov'
../go/src/github.com/klauspost/cpuid/cpuid_amd64.s:40: Error: too many memory references for `mov'

Inaccurate AVX-512 feature flags on i5-1030NG7

cpuid claims that AVX-512F is not supported on my Macbook, but I can execute the instructions just fine. Is this a bug in cpuid, or does the i5-1030NG7 report incorrect feature flags?? Here's the full CPU struct:

{
    BrandName:      "Intel(R) Core(TM) i5-1030NG7 CPU @ 1.10GHz",
    VendorID:       1,
    VendorString:   "GenuineIntel",
    Features:       "CMOV,NX,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,AVX2,FMA3,F16C,BMI1,BMI2,LZCNT,POPCNT,AESNI,CLMUL,HTT,RDRAND,RDSEED,ADX,SHA,ERMS,RDTSCP,CX16,SGX,SGXLC,IBPB,STIBP,VMX",
    Arm:            0x0,
    PhysicalCores:  4,
    ThreadsPerCore: 2,
    LogicalCores:   8,
    Family:         6,
    Model:          126,
    CacheLine:      64,
    Hz:             1113600000,
    Cache: {
        L1I: 32768,
        L1D: 49152,
        L2:  524288,
        L3:  6291456,
    },
    SGX: {
        Available:           true,
        LaunchControl:       true,
        SGX1Supported:       false,
        SGX2Supported:       false,
        MaxEnclaveSizeNot64: 1,
        MaxEnclaveSize64:    1,
        EPCSections:         []cpuid.SGXEPCSection{},
    },
    maxFunc:   0x1b,
    maxExFunc: 0x80000008,
}

No 'CONTRIBUTING.md' was found

Hi all,
@klauspost
@abourget
@ebfe

I'm from ARM. Currently I want to enable this project on arm64 platform.
Before the contribution, our legal team want to check inbound & outbound license.

I have found the outbound license, but didn't found the inbound license.

In general, the inbound license should be 'Developer Certificate of Origin, version 1.1'.
The legal information of inbound license should be in the file of 'CONTRIBUTING.md'.
And the legal information of outbound license should be in the file 'LICENSE'

Please see the project of 'runc' as reference:
https://github.com/opencontainers/runc/blob/master/CONTRIBUTING.md
https://github.com/opencontainers/runc/blob/master/LICENSE

Thanks.

cpuid_amd64.s:29 illegal instruction

$ go test
SIGILL: illegal instruction
PC=0x497234 m=0

goroutine 67 [running]:
github.com/klauspost/cpuid.asmXgetbv(0x6874754100000000, 0x4080000600f01, 0x178bfbff1e98220b, 0xd0047edfa, 0x4080000000001, 0x408001e98220b, 0x2000078017f1, 0x47dd77, 0x15, 0x0, ...)
        /home/anoobis/PRO/go/src/github.com/klauspost/cpuid/cpuid_amd64.s:29 +0x4 fp=0xc82009db50 sp=0xc82009db48
github.com/klauspost/cpuid.support(0x15)
        /home/anoobis/PRO/go/src/github.com/klauspost/cpuid/cpuid.go:793 +0x21a fp=0xc82009db90 sp=0xc82009db50
github.com/klauspost/cpuid.Detect()
        /home/anoobis/PRO/go/src/github.com/klauspost/cpuid/cpuid.go:191 +0x97 fp=0xc82009dbb8 sp=0xc82009db90
github.com/klauspost/cpuid.TestMocks(0xc8200a2360)
        /home/anoobis/PRO/go/src/github.com/klauspost/cpuid/mockcpu_test.go:147 +0x70e fp=0xc82009df58 sp=0xc82009dbb8
testing.tRunner(0xc8200a2360, 0x6b9e30)
        /opt/go/src/testing/testing.go:456 +0x98 fp=0xc82009df90 sp=0xc82009df58
runtime.goexit()
        /opt/go/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc82009df98 sp=0xc82009df90
created by testing.RunTests
        /opt/go/src/testing/testing.go:561 +0x86d

goroutine 1 [chan receive]:
testing.RunTests(0x61c410, 0x6b9860, 0x3f, 0x3f, 0x1)
        /opt/go/src/testing/testing.go:562 +0x8ad
testing.(*M).Run(0xc820047f08, 0xc82000a7d0)
        /opt/go/src/testing/testing.go:494 +0x70
main.main()
        github.com/klauspost/cpuid/_test/_testmain.go:178 +0x116

rax    0x2000038017f1
rbx    0x497230
rcx    0x0
rdx    0x61c3e8
rdi    0x40800
rsi    0x40800
rbp    0x600f01
rsp    0xc82009db48
r8     0xc82009d8e0
r9     0x2c
r10    0x0
r11    0x0
r12    0x2
r13    0x619d4d
r14    0x2
r15    0x8
rip    0x497234
rflags 0x10246
cs     0x33
fs     0x0
gs     0x0
exit status 2
FAIL    github.com/klauspost/cpuid      0.076s

OS: Linux 3.13.0-52-generic x86_64
CPU: AMD64 Athlon X2
go version go1.5 linux/amd64

RFC: How to handle >64 CPU features

Hi @klauspost,

I'd like to add AMX CPU features AMXBF16, AMXTILE, AMXINT8. However, we've hit the limit of 64 features in Flags (of type uint64).

So I'm wondering if you'd have a preference over following options, or a better idea:

  • Change CPUInfo.Features from uint64 to an alternative of arbitrary size (like map[int]bool, math.big.Int, bitarray) - and totally break the API.
  • Add "next leaf" like CPUInfo.Features2.
  • Add a "feature leaf" like CPUInfo.AMX that would hold subflags for this particular feature.
  • Add new feature structure (new API) of arbitrary size with current and new AMX features in it, and keep current CPUInfo.Features as is for backwards compatibility.
  • Something better?

Request: report number of physical chips

AFAICT there's no way to know how many physical processors exist, as cpuid only reports information for the cpu the current goroutine is running on. It would be very useful (for NUMA aware programs) to have the equivelent of

physical id : 0
siblings    : 8
core id     : 3
cpu cores   : 4

from /proc/cpuinfo for all physical cpus.

main.go:7:2: cannot find package "github.com/klauspost/cpuid/v2" in any of:

I listened to your suggestion.
now use github.com/klauspost/cpuid as import path, but it shows

github.com/go-sql-driver/mysql
../../go-sql-driver/mysql/driver.go:88:33: undefined: driver.Connector
../../go-sql-driver/mysql/driver.go:99:49: undefined: driver.Connector
../../go-sql-driver/mysql/nulltime.go:36:15: undefined: sql.NullTime

github.com/klauspost/cpuid
../../klauspost/cpuid/cpuid.go:394:30: syntax error: unexpected _000_000 at end of statement
../../klauspost/cpuid/cpuid.go:398:37: syntax error: unexpected _000_000 at end of statement

mac error

github.com/klauspost/cpuid

../github.com/klauspost/cpuid/cpuid.go:441:31: invalid operation: 1 << (feat & flagMask) (shift count type FeatureID, must be unsigned integer)
../github.com/klauspost/cpuid/cpuid.go:445:29: invalid operation: 1 << (feat & flagMask) (shift count type FeatureID, must be unsigned integer)
../github.com/klauspost/cpuid/cpuid.go:452:33: invalid operation: 1 << (offset & flagMask) (shift count type FeatureID, must be unsigned integer)
../github.com/klauspost/cpuid/cpuid.go:458:17: invalid operation: 1 << (offset & flagMask) (shift count type FeatureID, must be unsigned integer)

Possible SCE check issue

Reference code:

https://github.com/klauspost/cpuid/blob/master/cpuid.go#L996

According to the System V Application Binary Interface - AMD64 Architecture Processor Supplement, section 3.1.1:

Any program can expect that an AMD64 processor implements the baseline features mentioned in table 3.1. Most feature names correspond to CPUID bits, as described in the
processor manual. Exceptions are OSFXSR and SCE, which are controlled by bits in the
%cr4 register and the IA32_EFER MSR.

I understand that the presence of SCE must be checked using the MSR register

(You can generate the PDF mentioned above from https://gitlab.com/x86-psABIs/x86-64-ABI)

Example in Readme

Could you update output of example code in file README?
Now, I don't see L1 result.

Can not compile to amd64 in mac m1 arm

Build command:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o main.go

ERR MSG:
#github.com/klauspost/compress/flate
~/go/src/github.com/klauspost/compress/flate/crc32_amd64.go:41:22: cpuid.CPU.SSE42 undefined (type cpuid.CPUInfo has no field or method SSE42)

$go env
GO111MODULE="auto"
GOARCH="arm64"
GOBIN="/go/bin"
GOCACHE="
/Library/Caches/go-build"
GOENV="/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="
/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="~/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/opt/homebrew/Cellar/go/1.17.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.17.6/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8j/hl0nvryx4bx3_2cpqm2ljr3w0000gn/T/go-build944530538=/tmp/go-build -gno-record-gcc-switches -fno-common"

Can this package support detecting CPU microarchitecture information?

$ cpuid --version
cpuid version 20230505
$ cpuid -1 |grep synth
(family synth) = 0x6 (6)
(model synth) = 0x8f (143)
(simple synth) = Intel Xeon (unknown type) (Sapphire Rapids E5/B3) {Golden Cove}, Intel 7
(size synth) = 49152 (48 KB)
(size synth) = 32768 (32 KB)
(size synth) = 2097152 (2 MB)
(size synth) = 110100480 (105 MB)
(QoS monitoring counter size synth) = 32
(vuln to branch type confusion synth) = true
(multi-processing synth) = multi-core (c=56), hyper-threaded (t=2)
(APIC widths synth): CORE_width=6 SMT_width=1
(APIC synth): PKG_ID=1 CORE_ID=53 SMT_ID=1
(uarch synth) = Intel Sapphire Rapids {Golden Cove}, Intel 7
(synth) = Intel Scalable (4th Gen) Bronze/Silver/Gold/Platinum (Sapphire Rapids E5/B3) {Golden Cove}, Intel 7
$ cpuid -1 |grep uarch
(uarch synth) = Intel Sapphire Rapids {Golden Cove}, Intel 7

Crash Samsung s9 arm64

Hello I am using kcp-go v5.4.20, this library uses reedsolomon which links to cpuid v 1.3.0

I am getting the following error when trying to listen for a kcp connection when fecDecoder-> reedsolomon which calls the cpuid.initCPU function

--------- beginning of crash
2021-03-28 19:22:56.131 887-924/com.example.mobinet A/libc: Fatal signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x7e852c59f0 in tid 924 (example.mobinet), pid 887 (example.mobinet)
2021-03-28 19:22:56.166 933-933/? E/crash_dump64: unknown process state: t
2021-03-28 19:22:56.185 933-933/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-03-28 19:22:56.186 4738-4738/? I//system/bin/tombstoned: received crash request for pid 924
2021-03-28 19:22:56.187 933-933/? I/crash_dump64: performing dump of process 887 (target tid = 924)
2021-03-28 19:22:56.197 933-933/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-03-28 19:22:56.197 933-933/? A/DEBUG: Build fingerprint: 'samsung/starlteser/starlte:10/QP1A.190711.020/G960FXXU8DTC5:user/release-keys'
2021-03-28 19:22:56.197 933-933/? A/DEBUG: Revision: '26'
2021-03-28 19:22:56.197 933-933/? A/DEBUG: ABI: 'arm64'
2021-03-28 19:22:56.201 933-933/? A/DEBUG: Timestamp: 2021-03-28 19:22:56+0600
2021-03-28 19:22:56.201 933-933/? A/DEBUG: pid: 887, tid: 924, name: example.mobinet >>> com.example.mobinet <<<
2021-03-28 19:22:56.201 933-933/? A/DEBUG: uid: 10350
2021-03-28 19:22:56.201 933-933/? A/DEBUG: signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x7e852c59f0 (*pc=0xd5380400)
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x0 0000007e8587f300 x1 000000400010a3a0 x2 000000400010b5a0 x3 0000000000000000
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x4 0000000000000000 x5 0000000000000004 x6 0000007e8581bbe0 x7 0000000000000001
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x8 0000000000000002 x9 0000000000000004 x10 0000000000000000 x11 000000000000000d
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x12 0000000000000001 x13 0000007e851227e8 x14 0000000000000000 x15 000802aaaa00aaaa
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x16 0000000000000000 x17 0000000000000034 x18 0000007e840a8000 x19 0000000000000068
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x20 00000000000000d0 x21 0000004000146118 x22 fffffffffffffff7 x23 0000000000000008
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x24 ffffffffffffffa2 x25 0000007e85536a20 x26 0000007e8581bbe8 x27 fffffffffffffffb
2021-03-28 19:22:56.201 933-933/? A/DEBUG: x28 0000004000000180 x29 0000000000000000
2021-03-28 19:22:56.201 933-933/? A/DEBUG: sp 000000400010b570 lr 0000007e852c4a28 pc 0000007e852c59f0
2021-03-28 19:22:56.207 933-933/? A/DEBUG: backtrace:
2021-03-28 19:22:56.207 933-933/? A/DEBUG: #00 pc 000000000043f9f0 /data/app/com.example.mobinet-RRxiKLjoy_9misXpo2RfEw==/lib/arm64/libgojni.so (github.com/klauspost/cpuid.initCPU+192)

how can I avoid this error without changing the code of the libraries ?

please tag and version this project

Hello,

Can you please tag and version this project?

I am the Debian Maintainer for cpuid and versioning would help Debian keep up with development.

Number of cores not detected under VMware ESXi

cpuid output from Ubuntu VM running under VMware ESXi (note the number of Physical/Logical cores):

$ cpuid
Name: Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz
Vendor String: GenuineIntel
Vendor ID: Intel
PhysicalCores: 0
Threads Per Core: 1
Logical Cores: 0
CPU Family 6 Model: 44 Stepping: 2
Features: CMOV,CMPXCHG8,CX16,FXSR,FXSROPT,HYPERVISOR,LAHF,MMX,NX,OSXSAVE,POPCNT,RDTSCP,SSE,SSE2,SSE3,SSE4,SSE42,SSSE3,SYSCALL,SYSEE,X87,XSAVE
Microarchitecture level: 2
Cacheline bytes: 64
L1 Instruction Cache: 32768 bytes
L1 Data Cache: 32768 bytes
L2 Cache: 262144 bytes
L3 Cache: 12582912 bytes
Frequency: 3470000000 Hz

lscpu reports the correct number of cores:

$ lscpu
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      40 bits physical, 48 bits virtual
CPU(s):                             4
On-line CPU(s) list:                0-3
Thread(s) per core:                 1
Core(s) per socket:                 2
Socket(s):                          2
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              44
Model name:                         Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz
Stepping:                           2
CPU MHz:                            3466.789
BogoMIPS:                           6933.57
Hypervisor vendor:                  VMware
Virtualization type:                full
L1d cache:                          64 KiB
L1i cache:                          64 KiB
L2 cache:                           512 KiB
L3 cache:                           24 MiB
NUMA node0 CPU(s):                  0-3
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Vulnerable
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Unknown: No mitigations
Vulnerability Retbleed:             Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl tsc_reli
                                    able nonstop_tsc cpuid pni ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm pti arat

image

CPUID and NFD support: AVX_VNNI

Hi NFD Team,

I have ADL CPU, but i not have AVX_VNNI in label list.
I have v0.11.0 image and this issue is observed.

This ticket is imported from NFD project.
kubernetes-sigs/node-feature-discovery#844

{
"beta.kubernetes.io/arch": "amd64",
"beta.kubernetes.io/os": "linux",
"feature.node.kubernetes.io/cpu-cpuid.ADX": "true",
"feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
"feature.node.kubernetes.io/cpu-cpuid.AVX": "true",
"feature.node.kubernetes.io/cpu-cpuid.AVX2": "true",
"feature.node.kubernetes.io/cpu-cpuid.CETIBT": "true",
"feature.node.kubernetes.io/cpu-cpuid.CETSS": "true",
"feature.node.kubernetes.io/cpu-cpuid.CMPXCHG8": "true",
"feature.node.kubernetes.io/cpu-cpuid.FMA3": "true",
"feature.node.kubernetes.io/cpu-cpuid.FXSR": "true",
"feature.node.kubernetes.io/cpu-cpuid.FXSROPT": "true",
"feature.node.kubernetes.io/cpu-cpuid.IBPB": "true",
"feature.node.kubernetes.io/cpu-cpuid.LAHF": "true",
"feature.node.kubernetes.io/cpu-cpuid.MOVBE": "true",
"feature.node.kubernetes.io/cpu-cpuid.MOVDIR64B": "true",
"feature.node.kubernetes.io/cpu-cpuid.MOVDIRI": "true",
"feature.node.kubernetes.io/cpu-cpuid.OSXSAVE": "true",
"feature.node.kubernetes.io/cpu-cpuid.SCE": "true",
"feature.node.kubernetes.io/cpu-cpuid.SERIALIZE": "true",
"feature.node.kubernetes.io/cpu-cpuid.SHA": "true",
"feature.node.kubernetes.io/cpu-cpuid.STIBP": "true",
"feature.node.kubernetes.io/cpu-cpuid.VMX": "true",
"feature.node.kubernetes.io/cpu-cpuid.WAITPKG": "true",
"feature.node.kubernetes.io/cpu-cpuid.X87": "true",
"feature.node.kubernetes.io/cpu-cpuid.XSAVE": "true",
"feature.node.kubernetes.io/cpu-hardware_multithreading": "true",
"feature.node.kubernetes.io/cpu-model.family": "6",
"feature.node.kubernetes.io/cpu-model.id": "154",
"feature.node.kubernetes.io/cpu-model.vendor_id": "Intel",
"feature.node.kubernetes.io/cpu-pstate.scaling_governor": "powersave",
"feature.node.kubernetes.io/cpu-pstate.status": "active",
"feature.node.kubernetes.io/cpu-pstate.turbo": "true",
"feature.node.kubernetes.io/cpu-rdt.RDTL2CA": "true",
"feature.node.kubernetes.io/kernel-config.NO_HZ": "true",
"feature.node.kubernetes.io/kernel-config.NO_HZ_IDLE": "true",
"feature.node.kubernetes.io/kernel-version.full": "5.15.0-40-generic",
"feature.node.kubernetes.io/kernel-version.major": "5",
"feature.node.kubernetes.io/kernel-version.minor": "15",
"feature.node.kubernetes.io/kernel-version.revision": "0",
"feature.node.kubernetes.io/pci-0300_8086.present": "true",
"feature.node.kubernetes.io/pci-0300_8086.sriov.capable": "true",
"feature.node.kubernetes.io/storage-nonrotationaldisk": "true",
"feature.node.kubernetes.io/system-os_release.ID": "ubuntu",
"feature.node.kubernetes.io/system-os_release.VERSION_ID": "22.04",
"feature.node.kubernetes.io/system-os_release.VERSION_ID.major": "22",
"feature.node.kubernetes.io/system-os_release.VERSION_ID.minor": "04",
"gpu.intel.com/cards": "card0",
"kubernetes.io/arch": "amd64",
"kubernetes.io/hostname": "10.10.10.10",
"kubernetes.io/os": "linux",
"node-role.kubernetes.io/worker": "true"
}

cpuid -1 | grep AVX-VNNI
AVX-VNNI: AVX VNNI neural network instrs = true
This CPU feature is not implemented in NFD?

BR,
Ionut Nechita
ionutnechita

panic: runtime error: integer divide by zero in physicalCores

$ go test
panic: runtime error: integer divide by zero
[signal 0x8 code=0x1 addr=0x47cf4a pc=0x47cf4a]

goroutine 1 [running]:
github.com/klauspost/cpuid.physicalCores(0x0)
        /go/src/github.com/klauspost/cpuid/cpuid.go:595 +0x4a
github.com/klauspost/cpuid.Detect()
        /go/src/github.com/klauspost/cpuid/cpuid.go:181 +0xc7
github.com/klauspost/cpuid.init.1()
        /go/src/github.com/klauspost/cpuid/cpuid.go:162 +0x14
github.com/klauspost/cpuid.init()
        /go/src/github.com/klauspost/cpuid/cpuid_test.go:648 +0x1b0
main.init()
        github.com/klauspost/cpuid/_test/_testmain.go:176 +0x4a
exit status 2
FAIL    github.com/klauspost/cpuid      0.004s

The cpu in question is: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz

threadsPerCore() returns 0. Patching that to always return 1 gives the following info:

    cpuid_test.go:14: Max Function:0xd
    cpuid_test.go:16: Max Extended Function:0x80000008
    cpuid_test.go:19: CPUID.(EAX=07H):EBX: 0x0
    cpuid_test.go:21: Name: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
    cpuid_test.go:22: PhysicalCores: 0
    cpuid_test.go:23: ThreadsPerCore: 1
    cpuid_test.go:24: LogicalCores: 0
    cpuid_test.go:25: Family 6 Model: 23
    cpuid_test.go:26: Features: CMOV,NX,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,CX16
    cpuid_test.go:27: Cacheline bytes: 64
    cpuid_test.go:29: Yay - we have SSE 2

Let me know if you need more information.

Report processors with slow AVX

A number of processors support AVX but implement it by passing the vector though a 128 bit SSE ALU twice instead of using a 256 bit ALU. On these processors, AVX is thus not much faster than SSE. It would be great to have a feature flag that reports whether the current processor is afflicted by this problem. As far as I'm concerned, this affects the following processors, but I'm not super sure:

  • Intel Sandy Bridge, Ivy Bridge
  • AMD Jaguar/Puma
  • AMD “heavy equipment” processors
  • AMD Zen1

Difference in characteristics between lscpu and cpuid go implementation for AMD Ryzen

Hi NFD Team,

I try today to verify my features with cpuid go implementation.
But I noticed differences in features between cpuid your binary and lscpu.
Several features are missing.
Example: SVM for virtualization support

CPUID go implementation version: cpuid-Linux_x86_64_2.0.14
OS: openSUSE Tumbleweed 20220706
AMD CPU: AMD Ryzen 9 5900HS with Radeon Graphics

cpuid go: cpuid-go.txt
lscpu: lscpu.txt
cpuinfo: cpuinfo.txt
cpuid e0x: cpuid-e0x.txt

First file for diff: a.txt
Second file for diff: b.txt

Diff:
...
SVM | VTE
SVM_LOCK <
SYSCALL <
TCE <
TOPOEXT <
TSC <
TSC_SCALE <
UMIP <
VAES <
VGIF <
VMCB_CLEAN <
VME <
VMMCALL <
VPCLMULQDQ <
V_SPEC_CTRL <
V_VMSAVE_VMLOAD <
...

BR,
Ionut Nechita
ionutnechita

Incorrect detection of ThreadsPerCore

Library incorrectly detects ThreadsPerCore count, so PhysicalCore value is also wrong:

Name: Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
PhysicalCores: 1
ThreadsPerCore: 16
LogicalCores: 16
Family 6 Model: 45

Request: Please add TSX support

At first it seemed simple to just do the PR myself, but there were parts of the code I didn't understand, so I'm requesting the change instead...

Intel's Transactional Synchronization Extensions (TSX) support is somewhat unpredictable, given that there was a bug that led it to be disabled in Haswell and many Broadwell CPUs, and that it's not included in every Skylake and Kaby Lake model. So having it in CPUID would be especially helpful.

FTBFS issue on arm64

Latest 1.3.0 release fails on arm64, while previous 1.2.5 release built well:

Build log of arm64:

   dh_auto_test -O--buildsystem=golang
	cd obj-aarch64-linux-gnu && go test -vet=off -v -p 8 github.com/klauspost/cpuid
SIGILL: illegal instruction
PC=0x118520 m=0 sigcode=1

goroutine 1 [running, locked to thread]:
github.com/klauspost/cpuid.getProcFeatures(0x140760, 0x400018c210, 0x16d743, 0xc, 0x4000068ed8, 0x10cef4, 0x28a860, 0x10cef0, 0x4000068ee8, 0x4f78c, ...)
	/build/1st/golang-github-klauspost-cpuid-1.3.0+ds/obj-aarch64-linux-gnu/src/github.com/klauspost/cpuid/cpuid_arm64.s:15 fp=0x4000068e90 sp=0x4000068e90 pc=0x118520
github.com/klauspost/cpuid.addInfo(0x28a860)
	/build/1st/golang-github-klauspost-cpuid-1.3.0+ds/obj-aarch64-linux-gnu/src/github.com/klauspost/cpuid/detect_arm64.go:42 +0x20 fp=0x4000068ec0 sp=0x4000068e90 pc=0x10d620
github.com/klauspost/cpuid.Detect()
	/build/1st/golang-github-klauspost-cpuid-1.3.0+ds/obj-aarch64-linux-gnu/src/github.com/klauspost/cpuid/cpuid.go:289 +0x70 fp=0x4000068ee0 sp=0x4000068ec0 pc=0x10cf80
github.com/klauspost/cpuid.init.0()
	/build/1st/golang-github-klauspost-cpuid-1.3.0+ds/obj-aarch64-linux-gnu/src/github.com/klauspost/cpuid/cpuid.go:272 +0x24 fp=0x4000068ef0 sp=0x4000068ee0 pc=0x10cef4
runtime.doInit(0x2731c0)
	/usr/lib/go-1.14/src/runtime/proc.go:5420 +0x9c fp=0x4000068f30 sp=0x4000068ef0 pc=0x4f78c
runtime.doInit(0x272320)
	/usr/lib/go-1.14/src/runtime/proc.go:5415 +0x58 fp=0x4000068f70 sp=0x4000068f30 pc=0x4f748
runtime.main()
	/usr/lib/go-1.14/src/runtime/proc.go:190 +0x1b8 fp=0x4000068fd0 sp=0x4000068f70 pc=0x42838
runtime.goexit()
	/usr/lib/go-1.14/src/runtime/asm_arm64.s:1148 +0x4 fp=0x4000068fd0 sp=0x4000068fd0 pc=0x6f8b4

r0      0x28a860
r1      0x4000068380
r2      0x4000068ec0
r3      0x5
r4      0x140760
r5      0x0
r6      0x16d743
r7      0xa
r8      0xf
r9      0x4
r10     0x0
r11     0xd
r12     0x1
r13     0x802aaaa00aaaa
r14     0xf8
r15     0x0
r16     0x34
r17     0x68
r18     0x0
r19     0xd0
r20     0x4000068da8
r21     0xffffc1ed5840
r22     0x4000002000
r23     0x0
r24     0x0
r25     0x0
r26     0x273210
r27     0x28a8e8
r28     0x4000000180
r29     0x4000068e88
lr      0x10d620
sp      0x4000068e90
pc      0x118520
fault   0x0
FAIL	github.com/klauspost/cpuid	0.005s

Discussion: Support detecting confidential guests (TDX, SNP, SEV) running on Azure nodes

@klauspost, I'm creating this issue here as I really would like to hear your opinion on what could be done, and mainly if something should be done on cpuid in order to properly detect those.

We've had access to Azure Intel TDX preview, and we noticed that the TDX guest cpuid leaf was not exposed there. This is a huge situation, as it seems Azure is not willing to expose all the necessary bits, and there's already discussions that happened on the kernel land about this, like: https://lore.kernel.org/linux-hyperv/20231020202158.GHZTLhZpmes+uiHOE2@fat_crate.local/T/#t

Meanwhile, I've gotten to do some tests on the created TDX VM, and a "simple patch" like the one shown below could do the trick:

intel-coco@tdvm:~/fidencio/cpuid/cmd/cpuid$ git diff
diff --git a/cpuid.go b/cpuid.go
index b5fdc6e..0021df1 100644
--- a/cpuid.go
+++ b/cpuid.go
@@ -1418,6 +1418,11 @@ func support() flagSet {
                fs.setIf((a>>24)&1 == 1, VMSA_REGPROT)
        }
 
+       if mfi >= 0x20 {
+               _, ebx, _, _ := cpuid(0x4000000C)
+               fs.setIf(ebx == 0xbe3, TDX_GUEST)
+       }
+
        if mfi >= 0x21 {
                // Intel Trusted Domain Extensions Guests have their own cpuid leaf (0x21).
                _, ebx, ecx, edx := cpuid(0x21)

While this of TDX_GUEST, supporting things like SNP / SEV guest would basically be the matter of checking the ebx's value, as show here https://github.com/torvalds/linux/blob/master/arch/x86/kernel/cpu/mshyperv.c#L429-L445

At this point I'm rather unsure on whether this is an acceptable approach, but I'm confident we'd need something, at least something coming from cpuid side, so NFD could properly do the detection.

With everything written above, @klauspost, I'm super interested in your take on whether to accept a patch like the one above, or any other suggestsion on how to address this.

Let me cc some folks from Intel, Azure, and NVIDIA side here as well, just so they can add something that I may have missed and / or follow up in your suggestions.

/cc @mythi @jepio @zvonkok

Looks at CPUID leaves it should not

A few months ago, @fosslinux reported that this code package looped forever under Xen. This has since been fixed, but it turns out that this code does not check if TOPOEXT is exposed before using it. Feel free to close if this has since been fixed.

invalid operation: 1 << (feat & flagMask) (shift count type FeatureID, must be unsigned integer)

I was go geting your reedsolomon module, which happened to install this one as well. I'm given this error:

XXXXXXXXX:XXXXX$ go get -u -v github.com/klauspost/cpuid
github.com/klauspost/cpuid (download)
github.com/klauspost/cpuid
# github.com/klauspost/cpuid
../go/src/github.com/klauspost/cpuid/cpuid.go:443:31: invalid operation: 1 << (feat & flagMask) (shift count type FeatureID, must be unsigned integer)
../go/src/github.com/klauspost/cpuid/cpuid.go:447:29: invalid operation: 1 << (feat & flagMask) (shift count type FeatureID, must be unsigned integer)
../go/src/github.com/klauspost/cpuid/cpuid.go:454:33: invalid operation: 1 << (offset & flagMask) (shift count type FeatureID, must be unsigned integer)
../go/src/github.com/klauspost/cpuid/cpuid.go:460:17: invalid operation: 1 << (offset & flagMask) (shift count type FeatureID, must be unsigned integer)

Is this an error with my system? I'm using Debian 10 x64, if that helps. Thank you.

Processor cores not displayed correctly

Processor Information (dmidecode):

  • Socket Designation: U3E1
  • Type: Central Processor
  • Family: Core i9
  • Manufacturer: Intel(R) Corporation
  • Signature: Type 0, Family 6, Model 183, Stepping 1
  • Flags:
    • FPU (Floating-point unit on-chip)
    • VME (Virtual mode extension)
    • DE (Debugging extension)
    • PSE (Page size extension)
    • TSC (Time stamp counter)
    • MSR (Model specific registers)
    • PAE (Physical address extension)
    • MCE (Machine check exception)
    • CX8 (CMPXCHG8 instruction supported)
    • APIC (On-chip APIC hardware supported)
    • SEP (Fast system call)
    • MTRR (Memory type range registers)
    • PGE (Page global enable)
    • MCA (Machine check architecture)
    • CMOV (Conditional move instruction supported)
    • PAT (Page attribute table)
    • PSE-36 (36-bit page size extension)
    • CLFSH (CLFLUSH instruction supported)
    • DS (Debug store)
    • ACPI (ACPI supported)
    • MMX (MMX technology supported)
    • FXSR (FXSAVE and FXSTOR instructions supported)
    • SSE (Streaming SIMD extensions)
    • SSE2 (Streaming SIMD extensions 2)
    • SS (Self-snoop)
    • HTT (Multi-threading)
    • TM (Thermal monitor supported)
    • PBE (Pending break enabled)
  • Version: 13th Gen Intel(R) Core(TM) i9-13900HX
  • Voltage: 1.4 V
  • External Clock: 100 MHz
  • Max Speed: 5400 MHz
  • Current Speed: 4851 MHz
  • Status: Populated, Enabled
  • Core Count: 24
  • Core Enabled: 24
  • Thread Count: 32
  • Characteristics:
    • 64-bit capable
    • Multi-Core
    • Hardware Thread
    • Execute Protection
    • Enhanced Virtualization
    • Power/Performance Control

cpuid:

  • Name: 13th Gen Intel(R) Core(TM) i9-13900HX
  • Vendor String: GenuineIntel
  • Vendor ID: Intel
  • PhysicalCores: 16
  • Threads Per Core: 2
  • Logical Cores: 32
  • CPU Family 6 Model: 183 Stepping: 1
  • Features: ADX,AESNI,AVX,AVX2,AVXVNNI,BHI_CTRL,BMI1,BMI2,CETIBT,CETSS,CLMUL,CMOV,CMPXCHG8,CX16,ERMS,F16C,FLUSH_L1D,FMA3,FSRM,FXSR,FXSROPT,GFNI,HRESET,HTT,HYBRID_CPU,IA32_ARCH_CAP,IA32_CORE_CAP,IBPB,IDPRED_CTRL,KEYLOCKER,LAHF,LZCNT,MD_CLEAR,MMX,MOVBE,MOVDIR64B,MOVDIRI,NX,OSXSAVE,POPCNT,PSFD,RDRAND,RDSEED,RDTSCP,RRSBA_CTRL,SERIALIZE,SHA,SPEC_CTRL_SSBD,SSE,SSE2,SSE3,SSE4,SSE42,SSSE3,STIBP,STOSB_SHORT,SYSCALL,SYSEE,VAES,VMX,VPCLMULQDQ,WAITPKG,X87,XGETBV1,XSAVE,XSAVEC,XSAVEOPT,XSAVES
  • Microarchitecture level: 3
  • Cacheline bytes: 64
  • Frequency: 2400000000 Hz
  • Boost Frequency: 5400000000 Hz

v2.0.1 output on raspberry pi 4 / ubuntu 20 arm64

Build the example program on:

lsb_release:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

uname -a:

Linux pi64 5.4.0-1023-raspi #26-Ubuntu SMP PREEMPT Thu Nov 12 14:58:33 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

From /proc/cpuinfo:
...
Hardware : BCM2835
Revision : c03111
Serial : 1000000033c9f617
Model : Raspberry Pi 4 Model B Rev 1.1

Output:

ms@pi64:~/Sync/cpuid$ ./cpuid
Name:
PhysicalCores: 0
ThreadsPerCore: 1
LogicalCores: 0
Family 0 Model: 0 Vendor ID: VendorUnknown
Features: ARMCPUID,ASIMD,CRC32,EVTSTRM,FP
Cacheline bytes: 64
L1 Data Cache: -1 bytes
L1 Instruction Cache: -1 bytes
L2 Cache: -1 bytes
L3 Cache: -1 bytes
Frequency 0 hz

CPU without L3 cache shows -1 bytes of L3

Reference CPU:

image

Test CPU - Intel Pentium J5005:

image

Should be zero, should it? Third-parties go mad because ot this (such as github.com/dustin/go-humanize if we try to prettify the output)

Provide stepping information for Intel CPU

Here is a cpuinfo data

processor	: 11
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping	: 10
microcode	: 0xf0
cpu MHz		: 1259.110
cache size	: 12288 KB
physical id	: 0
siblings	: 12
core id		: 5
cpu cores	: 6
apicid		: 11
initial apicid	: 11
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes

It looks like cpuid does not provide a way to get the "stepping" information. Would it be possible to add API access to such CPU information?

Process hangs for an hour on init

Found this as it affects minio, which uses cpuid, but it is easily reproducible just using the example program. Running that example program on my machine hangs for about an hour, then the program continues normally. Seems to be due to this for-loop which loops about 4 billion times on my machine.

Here is my CPU spec (from /proc/cpuinfo) if it helps:

processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 25
model		: 80
model name	: AMD Ryzen 7 5700G with Radeon Graphics
stepping	: 0
microcode	: 0xa50000c
cpu MHz		: 3792.874
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cr8_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat umip pku ospke vaes vpclmulqdq rdpid
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7585.74
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 25
model		: 80
model name	: AMD Ryzen 7 5700G with Radeon Graphics
stepping	: 0
microcode	: 0xa50000c
cpu MHz		: 3792.874
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 4
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cr8_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat umip pku ospke vaes vpclmulqdq rdpid
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7608.95
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 25
model		: 80
model name	: AMD Ryzen 7 5700G with Radeon Graphics
stepping	: 0
microcode	: 0xa50000c
cpu MHz		: 3792.874
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 4
cpu cores	: 4
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cr8_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat umip pku ospke vaes vpclmulqdq rdpid
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7618.22
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 25
model		: 80
model name	: AMD Ryzen 7 5700G with Radeon Graphics
stepping	: 0
microcode	: 0xa50000c
cpu MHz		: 3792.874
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 6
cpu cores	: 4
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cr8_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat umip pku ospke vaes vpclmulqdq rdpid
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7608.25
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.