Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect GPUs #121

Merged
merged 28 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN curl -fLsS https://sourceforge.net/projects/e1000/files/ice%20stable/${ICE_V

# ipmitool from bookworm is broken and returns with error on most commands
FROM golang:1.22-bullseye as initrd-builder
ENV UROOT_GIT_SHA_OR_TAG=v0.13.0
ENV UROOT_GIT_SHA_OR_TAG=v0.13.1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
Expand Down
10 changes: 10 additions & 0 deletions cmd/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ func (r *Register) readHardwareDetails() (*v1.BootServiceRegisterRequest, error)
if err != nil {
return nil, fmt.Errorf("unable to get system cpu(s) %w", err)
}
r.log.Info("cpu", "processors", cpu.String())

gpu, err := ghw.GPU()
majst01 marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return nil, fmt.Errorf("unable to get system gpu(s) %w", err)
}

for _, g := range gpu.GraphicsCards {
r.log.Info("found gpu", "gpu", g.String(), "device info", g.DeviceInfo, "address", g.Address)
}

// Nics
nics := []*v1.MachineNic{}
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/google/uuid v1.6.0
github.com/grafana/loki-client-go v0.0.0-20230116142646-e7494d0ef70c
github.com/jaypipes/ghw v0.12.0
github.com/metal-stack/go-hal v0.5.1
github.com/metal-stack/go-hal v0.5.2-0.20240227072451-774fb16d95b4
github.com/metal-stack/go-lldpd v0.4.7
github.com/metal-stack/metal-api v0.28.0
github.com/metal-stack/metal-go v0.28.0
Expand All @@ -18,14 +18,14 @@ require (
// archiver must stay in version v2.1.0, see replace below
github.com/mholt/archiver v3.1.1+incompatible
github.com/pierrec/lz4/v4 v4.1.21
github.com/prometheus/common v0.47.0
github.com/samber/slog-loki/v3 v3.2.0
github.com/prometheus/common v0.48.0
github.com/samber/slog-loki/v3 v3.2.1
github.com/samber/slog-multi v1.0.2
github.com/u-root/u-root v0.13.0
github.com/u-root/u-root v0.13.1
github.com/vishvananda/netlink v1.2.1-beta.2
golang.org/x/sync v0.6.0
golang.org/x/sys v0.17.0
google.golang.org/grpc v1.61.1
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -49,7 +49,7 @@ require (
github.com/frankban/quicktest v1.14.6 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gliderlabs/ssh v0.3.6 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-jose/go-jose/v3 v3.0.2 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand Down Expand Up @@ -104,24 +104,24 @@ require (
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/prometheus v0.49.1 // indirect
github.com/prometheus/prometheus v0.50.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/samber/lo v1.39.0 // indirect
github.com/samber/slog-common v0.15.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/sethvargo/go-password v0.2.0 // indirect
github.com/stmcginnis/gofish v0.15.0 // indirect
github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a // indirect
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
Loading
Loading