Skip to content

Commit c81a3ac

Browse files
authored
Merge pull request #148 from klueska/update-12.5
Bump to NVML version 12.5
2 parents 2b86455 + 5f61a8a commit c81a3ac

File tree

12 files changed

+1167
-214
lines changed

12 files changed

+1167
-214
lines changed

gen/nvml/nvml.h

Lines changed: 215 additions & 89 deletions
Large diffs are not rendered by default.

gen/nvml/nvml.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ TRANSLATOR:
9696
- {action: replace, from: "^nvmlDeviceGetMPSComputeRunningProcesses$", to: "nvmlDeviceGetMPSComputeRunningProcesses_v1"}
9797
- {action: replace, from: "^nvmlDeviceGetGpuInstancePossiblePlacements$", to: "nvmlDeviceGetGpuInstancePossiblePlacements_v1"}
9898
- {action: replace, from: "^nvmlVgpuInstanceGetLicenseInfo$", to: "nvmlVgpuInstanceGetLicenseInfo_v1"}
99+
- {action: replace, from: "^nvmlDeviceGetDriverModel$", to: "nvmlDeviceGetDriverModel_v1"}
99100
- {transform: unexport}

pkg/nvml/const.go

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/nvml/device.go

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,13 @@ func (handler GpuInstanceProfileInfoHandler) V2() (GpuInstanceProfileInfo_v2, Re
20802080
return info, ret
20812081
}
20822082

2083+
func (handler GpuInstanceProfileInfoHandler) V3() (GpuInstanceProfileInfo_v3, Return) {
2084+
var info GpuInstanceProfileInfo_v3
2085+
info.Version = STRUCT_VERSION(info, 3)
2086+
ret := nvmlDeviceGetGpuInstanceProfileInfoV(handler.device, uint32(handler.profile), (*GpuInstanceProfileInfo_v2)(unsafe.Pointer(&info)))
2087+
return info, ret
2088+
}
2089+
20832090
func (l *library) DeviceGetGpuInstanceProfileInfoV(device Device, profile int) GpuInstanceProfileInfoHandler {
20842091
return device.GetGpuInstanceProfileInfoV(profile)
20852092
}
@@ -2227,6 +2234,13 @@ func (handler ComputeInstanceProfileInfoHandler) V2() (ComputeInstanceProfileInf
22272234
return info, ret
22282235
}
22292236

2237+
func (handler ComputeInstanceProfileInfoHandler) V3() (ComputeInstanceProfileInfo_v3, Return) {
2238+
var info ComputeInstanceProfileInfo_v3
2239+
info.Version = STRUCT_VERSION(info, 3)
2240+
ret := nvmlGpuInstanceGetComputeInstanceProfileInfoV(handler.gpuInstance, uint32(handler.profile), uint32(handler.engProfile), (*ComputeInstanceProfileInfo_v2)(unsafe.Pointer(&info)))
2241+
return info, ret
2242+
}
2243+
22302244
func (l *library) GpuInstanceGetComputeInstanceProfileInfoV(gpuInstance GpuInstance, profile int, engProfile int) ComputeInstanceProfileInfoHandler {
22312245
return gpuInstance.GetComputeInstanceProfileInfoV(profile, engProfile)
22322246
}
@@ -3041,3 +3055,47 @@ func (device nvmlDevice) GetSramEccErrorStatus() (EccSramErrorStatus, Return) {
30413055
ret := nvmlDeviceGetSramEccErrorStatus(device, &status)
30423056
return status, ret
30433057
}
3058+
3059+
// nvml.DeviceGetClockOffsets()
3060+
func (l *library) DeviceGetClockOffsets(device Device) (ClockOffset, Return) {
3061+
return device.GetClockOffsets()
3062+
}
3063+
3064+
func (device nvmlDevice) GetClockOffsets() (ClockOffset, Return) {
3065+
var info ClockOffset
3066+
info.Version = STRUCT_VERSION(info, 1)
3067+
ret := nvmlDeviceGetClockOffsets(device, &info)
3068+
return info, ret
3069+
}
3070+
3071+
// nvml.DeviceSetClockOffsets()
3072+
func (l *library) DeviceSetClockOffsets(device Device, info ClockOffset) Return {
3073+
return device.SetClockOffsets(info)
3074+
}
3075+
3076+
func (device nvmlDevice) SetClockOffsets(info ClockOffset) Return {
3077+
return nvmlDeviceSetClockOffsets(device, &info)
3078+
}
3079+
3080+
// nvml.DeviceGetDriverModel_v2()
3081+
func (l *library) DeviceGetDriverModel_v2(device Device) (DriverModel, DriverModel, Return) {
3082+
return device.GetDriverModel_v2()
3083+
}
3084+
3085+
func (device nvmlDevice) GetDriverModel_v2() (DriverModel, DriverModel, Return) {
3086+
var current, pending DriverModel
3087+
ret := nvmlDeviceGetDriverModel_v2(device, &current, &pending)
3088+
return current, pending, ret
3089+
}
3090+
3091+
// nvml.DeviceGetCapabilities()
3092+
func (l *library) DeviceGetCapabilities(device Device) (DeviceCapabilities, Return) {
3093+
return device.GetCapabilities()
3094+
}
3095+
3096+
func (device nvmlDevice) GetCapabilities() (DeviceCapabilities, Return) {
3097+
var caps DeviceCapabilities
3098+
caps.Version = STRUCT_VERSION(caps, 1)
3099+
ret := nvmlDeviceGetCapabilities(device, &caps)
3100+
return caps, ret
3101+
}

pkg/nvml/lib.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ var GetBlacklistDeviceCount = GetExcludedDeviceCount
163163
var GetBlacklistDeviceInfoByIndex = GetExcludedDeviceInfoByIndex
164164
var nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v1
165165
var nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v1
166+
var nvmlDeviceGetDriverModel = nvmlDeviceGetDriverModel_v1
166167

167168
// BlacklistDeviceInfo was replaced by ExcludedDeviceInfo
168169
type BlacklistDeviceInfo = ExcludedDeviceInfo
@@ -288,4 +289,8 @@ func (l *library) updateVersionedSymbols() {
288289
if err == nil {
289290
nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2
290291
}
292+
err = l.dl.Lookup("nvmlDeviceGetDriverModel_v2")
293+
if err == nil {
294+
nvmlDeviceGetDriverModel = nvmlDeviceGetDriverModel_v2
295+
}
291296
}

0 commit comments

Comments
 (0)