NVIDIA / go-nvml

Go Bindings for the NVIDIA Management Library (NVML)
Apache License 2.0
290 stars 62 forks source link

Update source for NVML header downloads to NVIDIA owned repo #124

Closed klueska closed 3 months ago

klueska commented 3 months ago

An example of running this now looks like:

$ make update-nvml-h
Found 9 NVML headers:

No.  Version   Upload Time
  1  12.5.39   2024-05-21T16:33:04
  2  12.4.127  2024-04-03T20:31:07
  3  12.4.99   2024-03-05T17:03:22
  4  12.3.101  2023-11-16T22:01:02
  5  12.3.52   2023-10-19T15:56:27
  6  12.2.140  2023-08-29T15:40:51
  7  12.2.128  2023-07-31T15:43:39
  8  12.2.81   2023-06-28T15:36:05
  9  12.1.105  2023-04-19T15:31:00

Pick an NVML header to update ([1]-9): 1

NVML version: 12.5.39

Updating nvml.h to 12.5.39 from https://gitlab.com/nvidia/headers/cuda-individual/nvml_dev/-/raw/v12.5.39/nvml.h ...
--2024-05-24 20:46:21--  https://gitlab.com/nvidia/headers/cuda-individual/nvml_dev/-/raw/v12.5.39/nvml.h
Resolving gitlab.com (gitlab.com)... 172.65.251.78, 2606:4700:90:0:f22e:fbec:5bed:a9b9
Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 595956 (582K) [text/plain]
Saving to: ‘/home/kklues/go-nvml/gen/nvml/nvml.h’

/home/kklues/go-nvml/gen/nvml/nvml.h            100%[=====================================================================================================>] 581.99K  --.-KB/s    in 0.006s

2024-05-24 20:46:21 (100 MB/s) - ‘/home/kklues/go-nvml/gen/nvml/nvml.h’ saved [595956/595956]

Successfully updated nvml.h to 12.5.39.
klueska commented 3 months ago

I don't want to clone the whole repo just to pull one file out of it and then delete the repo. What advantage would cloning serve?

XuehaiPan commented 3 months ago

I don't want to clone the whole repo just to pull one file out of it and then delete the repo.

The repo only contains three files: nvml.h, LICENSE, README.md.

What advantage would cloning serve?

  1. It would be easier to compare differences between tags (if we set it as a git submodule).
  2. A git clone (https://github.com/NVIDIA/go-nvml/pull/124#discussion_r1614616959 shows 18 tags) will pull more tags than RESTful API (https://github.com/NVIDIA/go-nvml/pull/124#issue-2316229103 shows 9 tags).
  3. Drop dependency for wget and jq.
klueska commented 3 months ago

I've updated my version to at least include all of the tags that it should (i.e. 18). @elezar what are your thoughts on using the REST API vs. cloning the whole repo?

klueska commented 3 months ago

I don't want to clone the whole repo just to pull one file out of it and then delete the repo.

The repo only contains three files: nvml.h, LICENSE, README.md.

It's not about the size of the repo, but about the cleanup that needs to get done if something goes wrong. I do not want to be including this as a submodule as we don't actually depend on it for anything other than getting the latest NVML header (when appropriate).