Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gen/nvml/generateapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func generatePackageMethodsComment(input GeneratableInterfacePoperties) (string,
var signature strings.Builder
comment := strings.Join(commentFmt, "\n")
comment = fmt.Sprintf(comment, input.Type)
signature.WriteString(fmt.Sprintf("%s\n", comment))
fmt.Fprintf(&signature, "%s\n", comment)
return signature.String(), nil
}

Expand All @@ -204,7 +204,7 @@ func generateInterfaceComment(input GeneratableInterfacePoperties) (string, erro
var signature strings.Builder
comment := strings.Join(commentFmt, "\n")
comment = fmt.Sprintf(comment, input.Interface, input.Type, strings.ToLower(input.Interface), input.Interface, input.Interface)
signature.WriteString(fmt.Sprintf("%s\n", comment))
fmt.Fprintf(&signature, "%s\n", comment)
return signature.String(), nil
}

Expand Down Expand Up @@ -232,7 +232,7 @@ func generatePackageMethods(sourceDir string, input GeneratableInterfacePopertie
func generateInterface(sourceDir string, input GeneratableInterfacePoperties) (string, error) {
var signature strings.Builder

signature.WriteString(fmt.Sprintf("type %s interface {\n", input.Interface))
fmt.Fprintf(&signature, "type %s interface {\n", input.Interface)

methods, err := extractMethodsFromPackage(sourceDir, input)
if err != nil {
Expand Down
117 changes: 100 additions & 17 deletions pkg/nvml/mock/dgxa100/mig-profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dgxa100

import (
Expand Down Expand Up @@ -132,6 +131,17 @@ var MIGProfiles = struct {
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 1,
MultiprocessorCount: 14,
SharedCopyEngineCount: 1,
SharedDecoderCount: 0,
SharedEncoderCount: 0,
SharedJpegCount: 0,
SharedOfaCount: 0,
},
},
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {
Expand All @@ -145,6 +155,17 @@ var MIGProfiles = struct {
SharedJpegCount: 1,
SharedOfaCount: 1,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 1,
MultiprocessorCount: 14,
SharedCopyEngineCount: 1,
SharedDecoderCount: 1,
SharedEncoderCount: 0,
SharedJpegCount: 1,
SharedOfaCount: 1,
},
},
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {
Expand All @@ -158,6 +179,17 @@ var MIGProfiles = struct {
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 1,
MultiprocessorCount: 14,
SharedCopyEngineCount: 1,
SharedDecoderCount: 1,
SharedEncoderCount: 0,
SharedJpegCount: 0,
SharedOfaCount: 0,
},
},
nvml.GPU_INSTANCE_PROFILE_2_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {
Expand All @@ -171,6 +203,17 @@ var MIGProfiles = struct {
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 2,
MultiprocessorCount: 14,
SharedCopyEngineCount: 2,
SharedDecoderCount: 1,
SharedEncoderCount: 0,
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE,
SliceCount: 2,
Expand All @@ -195,6 +238,17 @@ var MIGProfiles = struct {
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 3,
MultiprocessorCount: 14,
SharedCopyEngineCount: 3,
SharedDecoderCount: 2,
SharedEncoderCount: 0,
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE,
SliceCount: 2,
Expand Down Expand Up @@ -230,6 +284,17 @@ var MIGProfiles = struct {
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 4,
MultiprocessorCount: 14,
SharedCopyEngineCount: 4,
SharedDecoderCount: 2,
SharedEncoderCount: 0,
SharedJpegCount: 0,
SharedOfaCount: 0,
},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE,
SliceCount: 2,
Expand Down Expand Up @@ -265,6 +330,17 @@ var MIGProfiles = struct {
SharedJpegCount: 1,
SharedOfaCount: 1,
},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1,
SliceCount: 1,
InstanceCount: 7,
MultiprocessorCount: 14,
SharedCopyEngineCount: 7,
SharedDecoderCount: 5,
SharedEncoderCount: 0,
SharedJpegCount: 1,
SharedOfaCount: 1,
},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {
Id: nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE,
SliceCount: 2,
Expand Down Expand Up @@ -438,34 +514,41 @@ var MIGPlacements = struct {
// TODO: Fill out ComputeInstancePossiblePlacements
ComputeInstancePossiblePlacements: map[int]map[int][]nvml.ComputeInstancePlacement{
nvml.GPU_INSTANCE_PROFILE_1_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
},
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV1: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
},
nvml.GPU_INSTANCE_PROFILE_1_SLICE_REV2: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
},
nvml.GPU_INSTANCE_PROFILE_2_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
},
nvml.GPU_INSTANCE_PROFILE_3_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
},
nvml.GPU_INSTANCE_PROFILE_4_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
},
nvml.GPU_INSTANCE_PROFILE_7_SLICE: {
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: {},
nvml.COMPUTE_INSTANCE_PROFILE_2_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_3_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_4_SLICE: {},
nvml.COMPUTE_INSTANCE_PROFILE_7_SLICE: {},
},
},
}