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

How do i get the fields using golang? #40

Open
vickyvikas7988 opened this issue Jul 13, 2023 · 2 comments
Open

How do i get the fields using golang? #40

vickyvikas7988 opened this issue Jul 13, 2023 · 2 comments

Comments

@vickyvikas7988
Copy link

Team,

there is no samples available in the repository to retrieve the information of fields.

Lets say I want to extract DCGM_FI_DEV_PCIE_LINK_WIDTH for all the GPUs on the server.

Can someone help me how to extract this value?

It might be simple but I am struggling to retrieve it using go-lang

DCGM_FI_DEV_PCIE_LINK_WIDTH = 238

@nikkon-dev
Copy link
Collaborator

@vickyvikas7988,

You could see an example here:

func latestValuesForDevice(gpuId uint) (status DeviceStatus, err error) {

In general, to get any field value you first need to:

  1. Initialize dcgm client
  2. Create group
  3. Add devices to the group
  4. Create fields group
  5. Add fields to the group
  6. Enable watch for the field group and device group
  7. Get the latest values for the field group and the device group

@vickyvikas7988
Copy link
Author

vickyvikas7988 commented Jul 14, 2023

@nikkon-dev
I am unable to see below fields in https://github.com/NVIDIA/go-dcgm/blob/6d8fa5f863f805dd92c66a94ce5e5b037a24959c/pkg/dcgm/const.go file

DCGM_CLOCKS_THROTTLE_REASON_HW_SLOWDOWN
DCGM_CLOCKS_THROTTLE_REASON_SW_THERMAL
DCGM_CLOCKS_THROTTLE_REASON_HW_THERMAL
DCGM_CLOCKS_THROTTLE_REASON_HW_POWER_BRAKE

How do I use it?

#define DCGM_CLOCKS_THROTTLE_REASON_HW_SLOWDOWN 0x0000000000000008LL

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

No branches or pull requests

2 participants