NVIDIA / go-dcgm

Golang bindings for Nvidia Datacenter GPU Manager (DCGM)
Apache License 2.0
96 stars 27 forks source link

Fix darwin do not support `--export-dynamic` #50

Open zwpaper opened 11 months ago

zwpaper commented 11 months ago

which will met error:

go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: unknown option: --export-dynamic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
zwpaper commented 11 months ago

Hi @nvvfedorov, can you please also look at this one

nvvfedorov commented 11 months ago

Hi @nvvfedorov, can you please also look at this one

Thank you for your contribution. The dcgm (https://docs.nvidia.com/datacenter/dcgm/latest/user-guide/getting-started.html#supported-platforms) doesn't support platforms other than Linux. The fix may help compile dcgm-exporter for development purposes. However, the binary will not work on the Mac without the DCGM library, and the build doesn't guarantee that the compiled binary works as expected.

I think it makes sense to add a VS CODE dev container to the repository and use it for development. Here is the example from the DCGM library: https://github.com/NVIDIA/DCGM/blob/master/.devcontainer/devcontainer.json

zwpaper commented 11 months ago

Hi @nvvfedorov, I agree with you mostly, with my little two cents:

The dcgm doesn't support platforms other than Linux. The fix may help compile dcgm-exporter for development purposes.

yes, and local development is important for developers.

However, the binary will not work on the Mac without the DCGM library, and the build doesn't guarantee that the compiled binary works as expected.

it does not have to guarantee that, it works for development is all good enough, or there will be plant warnings in editors. and we will always build the test/release binary in a container.

I think it makes sense to add a VS CODE dev container to the repository and use it for development.

developers other than VSCode, it does not always have the container development env setup, or is not that necessary to setup one just for rolling into the development.

what's more, the go-dcgm has offered a darwin cgo header, it should offer a correct one.

nvvfedorov commented 11 months ago

Hi @nvvfedorov, I agree with you mostly, with my little two cents:

The dcgm doesn't support platforms other than Linux. The fix may help compile dcgm-exporter for development purposes.

yes, and local development is important for developers.

However, the binary will not work on the Mac without the DCGM library, and the build doesn't guarantee that the compiled binary works as expected.

it does not have to guarantee that, it works for development is all good enough, or there will be plant warnings in editors. and we will always build the test/release binary in a container.

I think it makes sense to add a VS CODE dev container to the repository and use it for development.

developers other than VSCode, it does not always have the container development env setup, or is not that necessary to setup one just for rolling into the development.

what's more, the go-dcgm has offered a darwin cgo header, it should offer a correct one.

It makes sense to me. @nikkon-dev , @glowkey, what do you think?

nvvfedorov commented 11 months ago

I am going to test the PR, and I will be back this week.