-
Notifications
You must be signed in to change notification settings - Fork 64
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
go\pkg\mod\github.com\!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:25:29: undefined: Return #49
Comments
@djsxianglei it seems as if you are running this on a Windows machine. As far as I am aware there is platform specific which has not yet been updated to support windows. We do have an issue open to track this (see #1) and any contributions would be welcome. |
@elezar thanks.I tried it in a linux environment. |
@djsxianglei did switching to Linux solve your issues? |
I am using a linux container and it fails with the following error
|
RTLD_DEEPBIND should be available as of glibc 2.3.4. |
v1.2.2 |
that doesn't sound like a glibc version to me, but rather a musl libc version (on which NVML is not supported). |
I'm having the same set of errors during building phase in an app that uses the nvml bindings.
The exact build command then looks this way: GOOS?=darwin
COMMIT ?= $(shell git describe --dirty --long --always)
VERSION := $(shell cat ./VERSION)
LDFLAGS_COMMON := -X main.commitSha=$(COMMIT) -X main.version=$(VERSION) -s -w
build: ## Build a binary
@CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "$(LDFLAGS_COMMON)" -o ./dist/resbeat
linux-%: image-build
@docker run --rm -v "$(PWD)":/service -w /service -e GOOS=linux romahlushko/resbeat-build:latest make $*
# make linux-build I'm ending up getting this error:
The error occurs when I'm compiling with
By the end of the day, I want to get this NVML integration completely option in the app, so the app could be ran in environments without GPU/NVIDIA libraries while supporting more capabilities if those pieces are present. So what is the best way to achieve that besides having ifs that would guard calling of the nvml bindings? |
@roma-glushko the following is an example of a Golang ap that we build which consumes We build this on MacOS regularly. Note that we also privide the following build flags: To ensure that this executable does not complain about missing symbols. |
@elezar thank you, Evan! This is probably what I needed. Let me try it myself and get back to you. P.S. You may consider referencing this somewhere in the readme as a vetted example of using nvml-go library. That should be helpful 🙌 |
@elezar Hey Evan, I have tried to add those additional env var, but it doesn't seem to help me to build the app on Mac: // this is the new command I have ended up trying:
CGO_LDFLAGS_ALLOW="-Wl,--unresolved-symbols=ignore-in-object-files" GOOS=darwin GOARCH=amd64 \
go build -ldflags "-s -w -X main.commitSha=1.0.2-8-ga481f406f6f1016-dirty -X main.version=1.0.3" -o ./dist/resbeat
# github.com/NVIDIA/go-nvml/pkg/dl
../../../go/pkg/mod/github.com/!n!v!i!d!i!a/[email protected]/pkg/dl/dl.go:34:18: could not determine kind of name for C.RTLD_DEEPBIND
make: *** [build] Error 1 I feel like those additional flags Then I have gone for another test and pulled the repo you have referenced. This is what I could see trying to run With So I'm really wondering how do you build and run apps with nvml-go bindings imported on Mac. |
We have not tested |
@elezar, Thank you! I actually ended up doing exactly this: Plus, I added a mock for non-linux environments: https://github.com/roma-glushko/resbeat/pull/26/files#diff-f06cf2c8d2d31474e8be3143614a45cf20827660ce264237d311c637c4ce30b6R2 Hope this will be helpful for someone else! |
Hello, I get a similar error when building it on Linux system:
I set the below env variables:
I run make build with the below args:
any pointers? |
@asm582 does setting |
Ok I did now I get below error:
|
Can you provide a minimal reproducer that we can run ourselves? Without the ability to reproduce this ourselves (or at least see the exact full of code being compiled) we are not going to be able to help much. |
Thanks for all your help, the project builds and I can deploy the container. On the Ubuntu machine, I got away with all the compile flags that were added earlier, the build step in the make file is as below, which is also provided by the kubebuilder scaffolding logic:
To build the container image, I used the dockerfile from the DRA repo with modifications added from the kubebuilder scaffolding :
I hope someone finds this helpful! |
go get github.com/NVIDIA/go-nvml/pkg/nvml error
D:\www\go-nvml>go get github.com/NVIDIA/go-nvml/pkg/nvml
github.com/NVIDIA/go-nvml/pkg/nvml
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:25:29: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:32:49: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:39:54: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:46:50: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:53:58: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:60:44: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:66:41: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:71:37: undefined: BrandType
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:71:48: undefined: Return
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\types_gen.go:9:10: undefined: _Ctype_struct_nvmlDevice_st
C:\Users\djs\go\pkg\mod\github.com!n!v!i!d!i!a\[email protected]\pkg\nvml\device.go:71:48: too many errors
The text was updated successfully, but these errors were encountered: