87f4b71df0
* client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips This PR adds detection of asymetric core types (Power & Efficiency) (P/E) when running on M1/M2 Apple Silicon CPUs. This functionality is provided by shoenig/go-m1cpu which makes use of the Apple IOKit framework to read undocumented registers containing CPU performance data. Currently working on getting that functionality merged upstream into gopsutil, but gopsutil would still not support detecting P vs E cores like this PR does. Also refactors the CPUFingerprinter code to handle the mixed core types, now setting power vs efficiency cpu attributes. For now the scheduler is still unaware of mixed core types - on Apple platforms tasks cannot reserve cores anyway so it doesn't matter, but at least now the total CPU shares available will be correct. Future work should include adding support for detecting P/E cores on the latest and upcoming Intel chips, where computation of total cpu shares is currently incorrect. For that, we should also include updating the scheduler to be core-type aware, so that tasks of resources.cores on Linux platforms can be assigned the correct number of CPU shares for the core type(s) they have been assigned. node attributes before cpu.arch = arm64 cpu.modelname = Apple M2 Pro cpu.numcores = 12 cpu.reservablecores = 0 cpu.totalcompute = 1000 node attributes after cpu.arch = arm64 cpu.frequency.efficiency = 2424 cpu.frequency.power = 3504 cpu.modelname = Apple M2 Pro cpu.numcores.efficiency = 4 cpu.numcores.power = 8 cpu.reservablecores = 0 cpu.totalcompute = 37728 * fingerprint/cpu: follow up cr items
24 lines
682 B
Modula-2
24 lines
682 B
Modula-2
module github.com/hashicorp/nomad/api
|
|
|
|
go 1.19
|
|
|
|
require (
|
|
github.com/docker/go-units v0.5.0
|
|
github.com/gorilla/websocket v1.5.0
|
|
github.com/hashicorp/cronexpr v1.1.1
|
|
github.com/hashicorp/go-cleanhttp v0.5.2
|
|
github.com/hashicorp/go-multierror v1.1.1
|
|
github.com/hashicorp/go-rootcerts v1.0.2
|
|
github.com/mitchellh/go-testing-interface v1.14.1
|
|
github.com/mitchellh/mapstructure v1.5.0
|
|
github.com/shoenig/test v0.6.3
|
|
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a
|
|
)
|
|
|
|
require (
|
|
github.com/google/go-cmp v0.5.9 // indirect
|
|
github.com/hashicorp/errwrap v1.0.0 // indirect
|
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
|
github.com/stretchr/testify v1.8.1 // indirect
|
|
)
|