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

Migrate from NVIDIA/go-nvlib to NVIDIA/go-nvml and link against nvidia-ml library #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TheAifam5
Copy link

Hey,

since the release 0.3.0 of NVIDIA/go-nvlib package, the nvml has been moved to NVIDIA/go-nvml.

Without migration, nvkind was screaming about missing symbol:

/usr/bin/nvkind: symbol lookup error: /usr/bin/nvkind: undefined symbol: nvmlDeviceCcuSetStreamState

Other problem was with symbol resolving, for some reason, nvkind binary did not had a dynamic dependency on libnvidia-ml.so:

ldd ./nvkind
	linux-vdso.so.1 (0x0000759e0209b000)
	libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x0000759e0206b000)
	libc.so.6 => /usr/lib64/libc.so.6 (0x0000759e01e6f000)
	/lib64/ld-linux-x86-64.so.2 (0x0000759e0209d000)

Decided to add an additional ldflags to explicitly link against the missing dependency, resulting in:

ldd ./nvkind
	linux-vdso.so.1 (0x0000777f36c7e000)
	libresolv.so.2 => /usr/lib64/libresolv.so.2 (0x0000777f36c4e000)
	libnvidia-ml.so.1 => /usr/lib64/libnvidia-ml.so.1 (0x0000777f35a00000)
	libc.so.6 => /usr/lib64/libc.so.6 (0x0000777f36a52000)
	libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x0000777f359fb000)
	libm.so.6 => /usr/lib64/libm.so.6 (0x0000777f35943000)
	libdl.so.2 => /usr/lib64/libdl.so.2 (0x0000777f3593e000)
	librt.so.1 => /usr/lib64/librt.so.1 (0x0000777f35939000)
	/lib64/ld-linux-x86-64.so.2 (0x0000777f36c80000)

Let me know if you are fine with this change.

Best regards,
TheAifam5

@@ -22,10 +23,10 @@ vendor:
go mod verify

test:
go test $(MODULE)/...
go test -ldflags "$(GO_LDFLAGS)" $(MODULE)/...
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is needed. Could you please check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants