diff --git a/pkg/dcgm/fields.go b/pkg/dcgm/fields.go index 2a0feaa..14b7bf8 100644 --- a/pkg/dcgm/fields.go +++ b/pkg/dcgm/fields.go @@ -218,8 +218,8 @@ func GetLatestValuesForFields(gpu uint, fields []Short) ([]FieldValue_v1, error) // parentId is the ID of the parent entity. // fields is a slice of field IDs to retrieve. // Returns a slice of field values and any error encountered. -func LinkGetLatestValues(index, parentId uint, fields []Short) ([]FieldValue_v1, error) { - slice := []byte{uint8(FE_SWITCH), uint8(index), uint8(parentId), 0} +func LinkGetLatestValues(index uint, parentType Field_Entity_Group, parentId uint, fields []Short) ([]FieldValue_v1, error) { + slice := []byte{uint8(parentType), uint8(index), uint8(parentId), 0} entityId := binary.LittleEndian.Uint32(slice) return EntityGetLatestValues(FE_LINK, uint(entityId), fields) } diff --git a/pkg/dcgm/gpu_group.go b/pkg/dcgm/gpu_group.go index 614f926..9ec6a75 100644 --- a/pkg/dcgm/gpu_group.go +++ b/pkg/dcgm/gpu_group.go @@ -76,10 +76,10 @@ func AddToGroup(groupID GroupHandle, gpuID uint) (err error) { } // AddLinkEntityToGroup adds a link entity to the group -func AddLinkEntityToGroup(groupID GroupHandle, index, parentID uint) (err error) { +func AddLinkEntityToGroup(groupID GroupHandle, index uint, entityGroupID Field_Entity_Group, parentID uint) (err error) { /* Only supported on little-endian systems currently */ slice := make([]byte, 4) - slice[0] = uint8(FE_SWITCH) + slice[0] = uint8(entityGroupID) binary.LittleEndian.PutUint16(slice[1:3], uint16(index)) slice[3] = uint8(parentID)