forked from NVIDIA/cuda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnvml_linux.pyx
More file actions
7485 lines (6045 loc) · 377 KB
/
nvml_linux.pyx
File metadata and controls
7485 lines (6045 loc) · 377 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly.
from libc.stdint cimport intptr_t, uintptr_t
import threading
from .utils import FunctionNotFoundError, NotSupportedError
from cuda.pathfinder import load_nvidia_dynamic_lib
###############################################################################
# Extern
###############################################################################
# You must 'from .utils import NotSupportedError' before using this template
cdef extern from "<dlfcn.h>" nogil:
void* dlopen(const char*, int)
char* dlerror()
void* dlsym(void*, const char*)
int dlclose(void*)
enum:
RTLD_LAZY
RTLD_NOW
RTLD_GLOBAL
RTLD_LOCAL
const void* RTLD_DEFAULT 'RTLD_DEFAULT'
cdef int get_cuda_version():
cdef void* handle = NULL
cdef int err, driver_ver = 0
# Load driver to check version
handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL)
if handle == NULL:
err_msg = dlerror()
raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})')
cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion")
if cuDriverGetVersion == NULL:
raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1')
err = (<int (*)(int*) noexcept nogil>cuDriverGetVersion)(&driver_ver)
if err != 0:
raise RuntimeError(f'cuDriverGetVersion returned error code {err}')
return driver_ver
###############################################################################
# Wrapper init
###############################################################################
cdef object __symbol_lock = threading.Lock()
cdef bint __py_nvml_init = False
cdef void* __nvmlInit_v2 = NULL
cdef void* __nvmlInitWithFlags = NULL
cdef void* __nvmlShutdown = NULL
cdef void* __nvmlErrorString = NULL
cdef void* __nvmlSystemGetDriverVersion = NULL
cdef void* __nvmlSystemGetNVMLVersion = NULL
cdef void* __nvmlSystemGetCudaDriverVersion = NULL
cdef void* __nvmlSystemGetCudaDriverVersion_v2 = NULL
cdef void* __nvmlSystemGetProcessName = NULL
cdef void* __nvmlSystemGetHicVersion = NULL
cdef void* __nvmlSystemGetTopologyGpuSet = NULL
cdef void* __nvmlSystemGetDriverBranch = NULL
cdef void* __nvmlUnitGetCount = NULL
cdef void* __nvmlUnitGetHandleByIndex = NULL
cdef void* __nvmlUnitGetUnitInfo = NULL
cdef void* __nvmlUnitGetLedState = NULL
cdef void* __nvmlUnitGetPsuInfo = NULL
cdef void* __nvmlUnitGetTemperature = NULL
cdef void* __nvmlUnitGetFanSpeedInfo = NULL
cdef void* __nvmlUnitGetDevices = NULL
cdef void* __nvmlDeviceGetCount_v2 = NULL
cdef void* __nvmlDeviceGetAttributes_v2 = NULL
cdef void* __nvmlDeviceGetHandleByIndex_v2 = NULL
cdef void* __nvmlDeviceGetHandleBySerial = NULL
cdef void* __nvmlDeviceGetHandleByUUID = NULL
cdef void* __nvmlDeviceGetHandleByUUIDV = NULL
cdef void* __nvmlDeviceGetHandleByPciBusId_v2 = NULL
cdef void* __nvmlDeviceGetName = NULL
cdef void* __nvmlDeviceGetBrand = NULL
cdef void* __nvmlDeviceGetIndex = NULL
cdef void* __nvmlDeviceGetSerial = NULL
cdef void* __nvmlDeviceGetModuleId = NULL
cdef void* __nvmlDeviceGetC2cModeInfoV = NULL
cdef void* __nvmlDeviceGetMemoryAffinity = NULL
cdef void* __nvmlDeviceGetCpuAffinityWithinScope = NULL
cdef void* __nvmlDeviceGetCpuAffinity = NULL
cdef void* __nvmlDeviceSetCpuAffinity = NULL
cdef void* __nvmlDeviceClearCpuAffinity = NULL
cdef void* __nvmlDeviceGetNumaNodeId = NULL
cdef void* __nvmlDeviceGetTopologyCommonAncestor = NULL
cdef void* __nvmlDeviceGetTopologyNearestGpus = NULL
cdef void* __nvmlDeviceGetP2PStatus = NULL
cdef void* __nvmlDeviceGetUUID = NULL
cdef void* __nvmlDeviceGetMinorNumber = NULL
cdef void* __nvmlDeviceGetBoardPartNumber = NULL
cdef void* __nvmlDeviceGetInforomVersion = NULL
cdef void* __nvmlDeviceGetInforomImageVersion = NULL
cdef void* __nvmlDeviceGetInforomConfigurationChecksum = NULL
cdef void* __nvmlDeviceValidateInforom = NULL
cdef void* __nvmlDeviceGetLastBBXFlushTime = NULL
cdef void* __nvmlDeviceGetDisplayMode = NULL
cdef void* __nvmlDeviceGetDisplayActive = NULL
cdef void* __nvmlDeviceGetPersistenceMode = NULL
cdef void* __nvmlDeviceGetPciInfoExt = NULL
cdef void* __nvmlDeviceGetPciInfo_v3 = NULL
cdef void* __nvmlDeviceGetMaxPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetGpuMaxPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetMaxPcieLinkWidth = NULL
cdef void* __nvmlDeviceGetCurrPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetCurrPcieLinkWidth = NULL
cdef void* __nvmlDeviceGetPcieThroughput = NULL
cdef void* __nvmlDeviceGetPcieReplayCounter = NULL
cdef void* __nvmlDeviceGetClockInfo = NULL
cdef void* __nvmlDeviceGetMaxClockInfo = NULL
cdef void* __nvmlDeviceGetGpcClkVfOffset = NULL
cdef void* __nvmlDeviceGetClock = NULL
cdef void* __nvmlDeviceGetMaxCustomerBoostClock = NULL
cdef void* __nvmlDeviceGetSupportedMemoryClocks = NULL
cdef void* __nvmlDeviceGetSupportedGraphicsClocks = NULL
cdef void* __nvmlDeviceGetAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceGetFanSpeed = NULL
cdef void* __nvmlDeviceGetFanSpeed_v2 = NULL
cdef void* __nvmlDeviceGetFanSpeedRPM = NULL
cdef void* __nvmlDeviceGetTargetFanSpeed = NULL
cdef void* __nvmlDeviceGetMinMaxFanSpeed = NULL
cdef void* __nvmlDeviceGetFanControlPolicy_v2 = NULL
cdef void* __nvmlDeviceGetNumFans = NULL
cdef void* __nvmlDeviceGetCoolerInfo = NULL
cdef void* __nvmlDeviceGetTemperatureV = NULL
cdef void* __nvmlDeviceGetTemperatureThreshold = NULL
cdef void* __nvmlDeviceGetMarginTemperature = NULL
cdef void* __nvmlDeviceGetThermalSettings = NULL
cdef void* __nvmlDeviceGetPerformanceState = NULL
cdef void* __nvmlDeviceGetCurrentClocksEventReasons = NULL
cdef void* __nvmlDeviceGetSupportedClocksEventReasons = NULL
cdef void* __nvmlDeviceGetPowerState = NULL
cdef void* __nvmlDeviceGetDynamicPstatesInfo = NULL
cdef void* __nvmlDeviceGetMemClkVfOffset = NULL
cdef void* __nvmlDeviceGetMinMaxClockOfPState = NULL
cdef void* __nvmlDeviceGetSupportedPerformanceStates = NULL
cdef void* __nvmlDeviceGetGpcClkMinMaxVfOffset = NULL
cdef void* __nvmlDeviceGetMemClkMinMaxVfOffset = NULL
cdef void* __nvmlDeviceGetClockOffsets = NULL
cdef void* __nvmlDeviceSetClockOffsets = NULL
cdef void* __nvmlDeviceGetPerformanceModes = NULL
cdef void* __nvmlDeviceGetCurrentClockFreqs = NULL
cdef void* __nvmlDeviceGetPowerManagementLimit = NULL
cdef void* __nvmlDeviceGetPowerManagementLimitConstraints = NULL
cdef void* __nvmlDeviceGetPowerManagementDefaultLimit = NULL
cdef void* __nvmlDeviceGetPowerUsage = NULL
cdef void* __nvmlDeviceGetTotalEnergyConsumption = NULL
cdef void* __nvmlDeviceGetEnforcedPowerLimit = NULL
cdef void* __nvmlDeviceGetGpuOperationMode = NULL
cdef void* __nvmlDeviceGetMemoryInfo_v2 = NULL
cdef void* __nvmlDeviceGetComputeMode = NULL
cdef void* __nvmlDeviceGetCudaComputeCapability = NULL
cdef void* __nvmlDeviceGetDramEncryptionMode = NULL
cdef void* __nvmlDeviceSetDramEncryptionMode = NULL
cdef void* __nvmlDeviceGetEccMode = NULL
cdef void* __nvmlDeviceGetDefaultEccMode = NULL
cdef void* __nvmlDeviceGetBoardId = NULL
cdef void* __nvmlDeviceGetMultiGpuBoard = NULL
cdef void* __nvmlDeviceGetTotalEccErrors = NULL
cdef void* __nvmlDeviceGetMemoryErrorCounter = NULL
cdef void* __nvmlDeviceGetUtilizationRates = NULL
cdef void* __nvmlDeviceGetEncoderUtilization = NULL
cdef void* __nvmlDeviceGetEncoderCapacity = NULL
cdef void* __nvmlDeviceGetEncoderStats = NULL
cdef void* __nvmlDeviceGetEncoderSessions = NULL
cdef void* __nvmlDeviceGetDecoderUtilization = NULL
cdef void* __nvmlDeviceGetJpgUtilization = NULL
cdef void* __nvmlDeviceGetOfaUtilization = NULL
cdef void* __nvmlDeviceGetFBCStats = NULL
cdef void* __nvmlDeviceGetFBCSessions = NULL
cdef void* __nvmlDeviceGetDriverModel_v2 = NULL
cdef void* __nvmlDeviceGetVbiosVersion = NULL
cdef void* __nvmlDeviceGetBridgeChipInfo = NULL
cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL
cdef void* __nvmlDeviceGetGraphicsRunningProcesses_v3 = NULL
cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL
cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL
cdef void* __nvmlDeviceOnSameBoard = NULL
cdef void* __nvmlDeviceGetAPIRestriction = NULL
cdef void* __nvmlDeviceGetSamples = NULL
cdef void* __nvmlDeviceGetBAR1MemoryInfo = NULL
cdef void* __nvmlDeviceGetIrqNum = NULL
cdef void* __nvmlDeviceGetNumGpuCores = NULL
cdef void* __nvmlDeviceGetPowerSource = NULL
cdef void* __nvmlDeviceGetMemoryBusWidth = NULL
cdef void* __nvmlDeviceGetPcieLinkMaxSpeed = NULL
cdef void* __nvmlDeviceGetPcieSpeed = NULL
cdef void* __nvmlDeviceGetAdaptiveClockInfoStatus = NULL
cdef void* __nvmlDeviceGetBusType = NULL
cdef void* __nvmlDeviceGetGpuFabricInfoV = NULL
cdef void* __nvmlSystemGetConfComputeCapabilities = NULL
cdef void* __nvmlSystemGetConfComputeState = NULL
cdef void* __nvmlDeviceGetConfComputeMemSizeInfo = NULL
cdef void* __nvmlSystemGetConfComputeGpusReadyState = NULL
cdef void* __nvmlDeviceGetConfComputeProtectedMemoryUsage = NULL
cdef void* __nvmlDeviceGetConfComputeGpuCertificate = NULL
cdef void* __nvmlDeviceGetConfComputeGpuAttestationReport = NULL
cdef void* __nvmlSystemGetConfComputeKeyRotationThresholdInfo = NULL
cdef void* __nvmlDeviceSetConfComputeUnprotectedMemSize = NULL
cdef void* __nvmlSystemSetConfComputeGpusReadyState = NULL
cdef void* __nvmlSystemSetConfComputeKeyRotationThresholdInfo = NULL
cdef void* __nvmlSystemGetConfComputeSettings = NULL
cdef void* __nvmlDeviceGetGspFirmwareVersion = NULL
cdef void* __nvmlDeviceGetGspFirmwareMode = NULL
cdef void* __nvmlDeviceGetSramEccErrorStatus = NULL
cdef void* __nvmlDeviceGetAccountingMode = NULL
cdef void* __nvmlDeviceGetAccountingStats = NULL
cdef void* __nvmlDeviceGetAccountingPids = NULL
cdef void* __nvmlDeviceGetAccountingBufferSize = NULL
cdef void* __nvmlDeviceGetRetiredPages = NULL
cdef void* __nvmlDeviceGetRetiredPages_v2 = NULL
cdef void* __nvmlDeviceGetRetiredPagesPendingStatus = NULL
cdef void* __nvmlDeviceGetRemappedRows = NULL
cdef void* __nvmlDeviceGetRowRemapperHistogram = NULL
cdef void* __nvmlDeviceGetArchitecture = NULL
cdef void* __nvmlDeviceGetClkMonStatus = NULL
cdef void* __nvmlDeviceGetProcessUtilization = NULL
cdef void* __nvmlDeviceGetProcessesUtilizationInfo = NULL
cdef void* __nvmlDeviceGetPlatformInfo = NULL
cdef void* __nvmlUnitSetLedState = NULL
cdef void* __nvmlDeviceSetPersistenceMode = NULL
cdef void* __nvmlDeviceSetComputeMode = NULL
cdef void* __nvmlDeviceSetEccMode = NULL
cdef void* __nvmlDeviceClearEccErrorCounts = NULL
cdef void* __nvmlDeviceSetDriverModel = NULL
cdef void* __nvmlDeviceSetGpuLockedClocks = NULL
cdef void* __nvmlDeviceResetGpuLockedClocks = NULL
cdef void* __nvmlDeviceSetMemoryLockedClocks = NULL
cdef void* __nvmlDeviceResetMemoryLockedClocks = NULL
cdef void* __nvmlDeviceSetAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceSetDefaultFanSpeed_v2 = NULL
cdef void* __nvmlDeviceSetFanControlPolicy = NULL
cdef void* __nvmlDeviceSetTemperatureThreshold = NULL
cdef void* __nvmlDeviceSetGpuOperationMode = NULL
cdef void* __nvmlDeviceSetAPIRestriction = NULL
cdef void* __nvmlDeviceSetFanSpeed_v2 = NULL
cdef void* __nvmlDeviceSetAccountingMode = NULL
cdef void* __nvmlDeviceClearAccountingPids = NULL
cdef void* __nvmlDeviceSetPowerManagementLimit_v2 = NULL
cdef void* __nvmlDeviceGetNvLinkState = NULL
cdef void* __nvmlDeviceGetNvLinkVersion = NULL
cdef void* __nvmlDeviceGetNvLinkCapability = NULL
cdef void* __nvmlDeviceGetNvLinkRemotePciInfo_v2 = NULL
cdef void* __nvmlDeviceGetNvLinkErrorCounter = NULL
cdef void* __nvmlDeviceResetNvLinkErrorCounters = NULL
cdef void* __nvmlDeviceGetNvLinkRemoteDeviceType = NULL
cdef void* __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = NULL
cdef void* __nvmlSystemSetNvlinkBwMode = NULL
cdef void* __nvmlSystemGetNvlinkBwMode = NULL
cdef void* __nvmlDeviceGetNvlinkSupportedBwModes = NULL
cdef void* __nvmlDeviceGetNvlinkBwMode = NULL
cdef void* __nvmlDeviceSetNvlinkBwMode = NULL
cdef void* __nvmlEventSetCreate = NULL
cdef void* __nvmlDeviceRegisterEvents = NULL
cdef void* __nvmlDeviceGetSupportedEventTypes = NULL
cdef void* __nvmlEventSetWait_v2 = NULL
cdef void* __nvmlEventSetFree = NULL
cdef void* __nvmlSystemEventSetCreate = NULL
cdef void* __nvmlSystemEventSetFree = NULL
cdef void* __nvmlSystemRegisterEvents = NULL
cdef void* __nvmlSystemEventSetWait = NULL
cdef void* __nvmlDeviceModifyDrainState = NULL
cdef void* __nvmlDeviceQueryDrainState = NULL
cdef void* __nvmlDeviceRemoveGpu_v2 = NULL
cdef void* __nvmlDeviceDiscoverGpus = NULL
cdef void* __nvmlDeviceGetFieldValues = NULL
cdef void* __nvmlDeviceClearFieldValues = NULL
cdef void* __nvmlDeviceGetVirtualizationMode = NULL
cdef void* __nvmlDeviceGetHostVgpuMode = NULL
cdef void* __nvmlDeviceSetVirtualizationMode = NULL
cdef void* __nvmlDeviceGetVgpuHeterogeneousMode = NULL
cdef void* __nvmlDeviceSetVgpuHeterogeneousMode = NULL
cdef void* __nvmlVgpuInstanceGetPlacementId = NULL
cdef void* __nvmlDeviceGetVgpuTypeSupportedPlacements = NULL
cdef void* __nvmlDeviceGetVgpuTypeCreatablePlacements = NULL
cdef void* __nvmlVgpuTypeGetGspHeapSize = NULL
cdef void* __nvmlVgpuTypeGetFbReservation = NULL
cdef void* __nvmlVgpuInstanceGetRuntimeStateSize = NULL
cdef void* __nvmlDeviceSetVgpuCapabilities = NULL
cdef void* __nvmlDeviceGetGridLicensableFeatures_v4 = NULL
cdef void* __nvmlGetVgpuDriverCapabilities = NULL
cdef void* __nvmlDeviceGetVgpuCapabilities = NULL
cdef void* __nvmlDeviceGetSupportedVgpus = NULL
cdef void* __nvmlDeviceGetCreatableVgpus = NULL
cdef void* __nvmlVgpuTypeGetClass = NULL
cdef void* __nvmlVgpuTypeGetName = NULL
cdef void* __nvmlVgpuTypeGetGpuInstanceProfileId = NULL
cdef void* __nvmlVgpuTypeGetDeviceID = NULL
cdef void* __nvmlVgpuTypeGetFramebufferSize = NULL
cdef void* __nvmlVgpuTypeGetNumDisplayHeads = NULL
cdef void* __nvmlVgpuTypeGetResolution = NULL
cdef void* __nvmlVgpuTypeGetLicense = NULL
cdef void* __nvmlVgpuTypeGetFrameRateLimit = NULL
cdef void* __nvmlVgpuTypeGetMaxInstances = NULL
cdef void* __nvmlVgpuTypeGetMaxInstancesPerVm = NULL
cdef void* __nvmlVgpuTypeGetBAR1Info = NULL
cdef void* __nvmlDeviceGetActiveVgpus = NULL
cdef void* __nvmlVgpuInstanceGetVmID = NULL
cdef void* __nvmlVgpuInstanceGetUUID = NULL
cdef void* __nvmlVgpuInstanceGetVmDriverVersion = NULL
cdef void* __nvmlVgpuInstanceGetFbUsage = NULL
cdef void* __nvmlVgpuInstanceGetLicenseStatus = NULL
cdef void* __nvmlVgpuInstanceGetType = NULL
cdef void* __nvmlVgpuInstanceGetFrameRateLimit = NULL
cdef void* __nvmlVgpuInstanceGetEccMode = NULL
cdef void* __nvmlVgpuInstanceGetEncoderCapacity = NULL
cdef void* __nvmlVgpuInstanceSetEncoderCapacity = NULL
cdef void* __nvmlVgpuInstanceGetEncoderStats = NULL
cdef void* __nvmlVgpuInstanceGetEncoderSessions = NULL
cdef void* __nvmlVgpuInstanceGetFBCStats = NULL
cdef void* __nvmlVgpuInstanceGetFBCSessions = NULL
cdef void* __nvmlVgpuInstanceGetGpuInstanceId = NULL
cdef void* __nvmlVgpuInstanceGetGpuPciId = NULL
cdef void* __nvmlVgpuTypeGetCapabilities = NULL
cdef void* __nvmlVgpuInstanceGetMdevUUID = NULL
cdef void* __nvmlGpuInstanceGetCreatableVgpus = NULL
cdef void* __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = NULL
cdef void* __nvmlGpuInstanceGetActiveVgpus = NULL
cdef void* __nvmlGpuInstanceSetVgpuSchedulerState = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerState = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog = NULL
cdef void* __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = NULL
cdef void* __nvmlGpuInstanceGetVgpuHeterogeneousMode = NULL
cdef void* __nvmlGpuInstanceSetVgpuHeterogeneousMode = NULL
cdef void* __nvmlVgpuInstanceGetMetadata = NULL
cdef void* __nvmlDeviceGetVgpuMetadata = NULL
cdef void* __nvmlGetVgpuCompatibility = NULL
cdef void* __nvmlDeviceGetPgpuMetadataString = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerLog = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerState = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerCapabilities = NULL
cdef void* __nvmlDeviceSetVgpuSchedulerState = NULL
cdef void* __nvmlGetVgpuVersion = NULL
cdef void* __nvmlSetVgpuVersion = NULL
cdef void* __nvmlDeviceGetVgpuUtilization = NULL
cdef void* __nvmlDeviceGetVgpuInstancesUtilizationInfo = NULL
cdef void* __nvmlDeviceGetVgpuProcessUtilization = NULL
cdef void* __nvmlDeviceGetVgpuProcessesUtilizationInfo = NULL
cdef void* __nvmlVgpuInstanceGetAccountingMode = NULL
cdef void* __nvmlVgpuInstanceGetAccountingPids = NULL
cdef void* __nvmlVgpuInstanceGetAccountingStats = NULL
cdef void* __nvmlVgpuInstanceClearAccountingPids = NULL
cdef void* __nvmlVgpuInstanceGetLicenseInfo_v2 = NULL
cdef void* __nvmlGetExcludedDeviceCount = NULL
cdef void* __nvmlGetExcludedDeviceInfoByIndex = NULL
cdef void* __nvmlDeviceSetMigMode = NULL
cdef void* __nvmlDeviceGetMigMode = NULL
cdef void* __nvmlDeviceGetGpuInstanceProfileInfoV = NULL
cdef void* __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = NULL
cdef void* __nvmlDeviceGetGpuInstanceRemainingCapacity = NULL
cdef void* __nvmlDeviceCreateGpuInstance = NULL
cdef void* __nvmlDeviceCreateGpuInstanceWithPlacement = NULL
cdef void* __nvmlGpuInstanceDestroy = NULL
cdef void* __nvmlDeviceGetGpuInstances = NULL
cdef void* __nvmlDeviceGetGpuInstanceById = NULL
cdef void* __nvmlGpuInstanceGetInfo = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceProfileInfoV = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = NULL
cdef void* __nvmlGpuInstanceGetComputeInstancePossiblePlacements = NULL
cdef void* __nvmlGpuInstanceCreateComputeInstance = NULL
cdef void* __nvmlGpuInstanceCreateComputeInstanceWithPlacement = NULL
cdef void* __nvmlComputeInstanceDestroy = NULL
cdef void* __nvmlGpuInstanceGetComputeInstances = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceById = NULL
cdef void* __nvmlComputeInstanceGetInfo_v2 = NULL
cdef void* __nvmlDeviceIsMigDeviceHandle = NULL
cdef void* __nvmlDeviceGetGpuInstanceId = NULL
cdef void* __nvmlDeviceGetComputeInstanceId = NULL
cdef void* __nvmlDeviceGetMaxMigDeviceCount = NULL
cdef void* __nvmlDeviceGetMigDeviceHandleByIndex = NULL
cdef void* __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = NULL
cdef void* __nvmlDeviceGetCapabilities = NULL
cdef void* __nvmlDevicePowerSmoothingActivatePresetProfile = NULL
cdef void* __nvmlDevicePowerSmoothingUpdatePresetProfileParam = NULL
cdef void* __nvmlDevicePowerSmoothingSetState = NULL
cdef void* __nvmlDeviceGetAddressingMode = NULL
cdef void* __nvmlDeviceGetRepairStatus = NULL
cdef void* __nvmlDeviceGetPowerMizerMode_v1 = NULL
cdef void* __nvmlDeviceSetPowerMizerMode_v1 = NULL
cdef void* __nvmlDeviceGetPdi = NULL
cdef void* __nvmlDeviceSetHostname_v1 = NULL
cdef void* __nvmlDeviceGetHostname_v1 = NULL
cdef void* __nvmlDeviceGetNvLinkInfo = NULL
cdef void* __nvmlDeviceReadWritePRM_v1 = NULL
cdef void* __nvmlDeviceGetGpuInstanceProfileInfoByIdV = NULL
cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL
cdef void* __nvmlDeviceGetUnrepairableMemoryFlag_v1 = NULL
cdef void* __nvmlDeviceReadPRMCounters_v1 = NULL
cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL
cdef void* __nvmlDeviceVgpuForceGspUnload = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerState_v2 = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerState_v2 = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL
cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL
cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL
cdef void* load_library() except* with gil:
cdef uintptr_t handle = load_nvidia_dynamic_lib("nvml")._handle_uint
return <void*>handle
cdef int _init_nvml() except -1 nogil:
global __py_nvml_init
cdef void* handle = NULL
with gil, __symbol_lock:
# Recheck the flag after obtaining the locks
if __py_nvml_init:
return 0
# Load function
global __nvmlInit_v2
__nvmlInit_v2 = dlsym(RTLD_DEFAULT, 'nvmlInit_v2')
if __nvmlInit_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlInit_v2 = dlsym(handle, 'nvmlInit_v2')
global __nvmlInitWithFlags
__nvmlInitWithFlags = dlsym(RTLD_DEFAULT, 'nvmlInitWithFlags')
if __nvmlInitWithFlags == NULL:
if handle == NULL:
handle = load_library()
__nvmlInitWithFlags = dlsym(handle, 'nvmlInitWithFlags')
global __nvmlShutdown
__nvmlShutdown = dlsym(RTLD_DEFAULT, 'nvmlShutdown')
if __nvmlShutdown == NULL:
if handle == NULL:
handle = load_library()
__nvmlShutdown = dlsym(handle, 'nvmlShutdown')
global __nvmlErrorString
__nvmlErrorString = dlsym(RTLD_DEFAULT, 'nvmlErrorString')
if __nvmlErrorString == NULL:
if handle == NULL:
handle = load_library()
__nvmlErrorString = dlsym(handle, 'nvmlErrorString')
global __nvmlSystemGetDriverVersion
__nvmlSystemGetDriverVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetDriverVersion')
if __nvmlSystemGetDriverVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetDriverVersion = dlsym(handle, 'nvmlSystemGetDriverVersion')
global __nvmlSystemGetNVMLVersion
__nvmlSystemGetNVMLVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetNVMLVersion')
if __nvmlSystemGetNVMLVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetNVMLVersion = dlsym(handle, 'nvmlSystemGetNVMLVersion')
global __nvmlSystemGetCudaDriverVersion
__nvmlSystemGetCudaDriverVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion')
if __nvmlSystemGetCudaDriverVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetCudaDriverVersion = dlsym(handle, 'nvmlSystemGetCudaDriverVersion')
global __nvmlSystemGetCudaDriverVersion_v2
__nvmlSystemGetCudaDriverVersion_v2 = dlsym(RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion_v2')
if __nvmlSystemGetCudaDriverVersion_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetCudaDriverVersion_v2 = dlsym(handle, 'nvmlSystemGetCudaDriverVersion_v2')
global __nvmlSystemGetProcessName
__nvmlSystemGetProcessName = dlsym(RTLD_DEFAULT, 'nvmlSystemGetProcessName')
if __nvmlSystemGetProcessName == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetProcessName = dlsym(handle, 'nvmlSystemGetProcessName')
global __nvmlSystemGetHicVersion
__nvmlSystemGetHicVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetHicVersion')
if __nvmlSystemGetHicVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetHicVersion = dlsym(handle, 'nvmlSystemGetHicVersion')
global __nvmlSystemGetTopologyGpuSet
__nvmlSystemGetTopologyGpuSet = dlsym(RTLD_DEFAULT, 'nvmlSystemGetTopologyGpuSet')
if __nvmlSystemGetTopologyGpuSet == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetTopologyGpuSet = dlsym(handle, 'nvmlSystemGetTopologyGpuSet')
global __nvmlSystemGetDriverBranch
__nvmlSystemGetDriverBranch = dlsym(RTLD_DEFAULT, 'nvmlSystemGetDriverBranch')
if __nvmlSystemGetDriverBranch == NULL:
if handle == NULL:
handle = load_library()
__nvmlSystemGetDriverBranch = dlsym(handle, 'nvmlSystemGetDriverBranch')
global __nvmlUnitGetCount
__nvmlUnitGetCount = dlsym(RTLD_DEFAULT, 'nvmlUnitGetCount')
if __nvmlUnitGetCount == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetCount = dlsym(handle, 'nvmlUnitGetCount')
global __nvmlUnitGetHandleByIndex
__nvmlUnitGetHandleByIndex = dlsym(RTLD_DEFAULT, 'nvmlUnitGetHandleByIndex')
if __nvmlUnitGetHandleByIndex == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetHandleByIndex = dlsym(handle, 'nvmlUnitGetHandleByIndex')
global __nvmlUnitGetUnitInfo
__nvmlUnitGetUnitInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetUnitInfo')
if __nvmlUnitGetUnitInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetUnitInfo = dlsym(handle, 'nvmlUnitGetUnitInfo')
global __nvmlUnitGetLedState
__nvmlUnitGetLedState = dlsym(RTLD_DEFAULT, 'nvmlUnitGetLedState')
if __nvmlUnitGetLedState == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetLedState = dlsym(handle, 'nvmlUnitGetLedState')
global __nvmlUnitGetPsuInfo
__nvmlUnitGetPsuInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetPsuInfo')
if __nvmlUnitGetPsuInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetPsuInfo = dlsym(handle, 'nvmlUnitGetPsuInfo')
global __nvmlUnitGetTemperature
__nvmlUnitGetTemperature = dlsym(RTLD_DEFAULT, 'nvmlUnitGetTemperature')
if __nvmlUnitGetTemperature == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetTemperature = dlsym(handle, 'nvmlUnitGetTemperature')
global __nvmlUnitGetFanSpeedInfo
__nvmlUnitGetFanSpeedInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetFanSpeedInfo')
if __nvmlUnitGetFanSpeedInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetFanSpeedInfo = dlsym(handle, 'nvmlUnitGetFanSpeedInfo')
global __nvmlUnitGetDevices
__nvmlUnitGetDevices = dlsym(RTLD_DEFAULT, 'nvmlUnitGetDevices')
if __nvmlUnitGetDevices == NULL:
if handle == NULL:
handle = load_library()
__nvmlUnitGetDevices = dlsym(handle, 'nvmlUnitGetDevices')
global __nvmlDeviceGetCount_v2
__nvmlDeviceGetCount_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCount_v2')
if __nvmlDeviceGetCount_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCount_v2 = dlsym(handle, 'nvmlDeviceGetCount_v2')
global __nvmlDeviceGetAttributes_v2
__nvmlDeviceGetAttributes_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAttributes_v2')
if __nvmlDeviceGetAttributes_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetAttributes_v2 = dlsym(handle, 'nvmlDeviceGetAttributes_v2')
global __nvmlDeviceGetHandleByIndex_v2
__nvmlDeviceGetHandleByIndex_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByIndex_v2')
if __nvmlDeviceGetHandleByIndex_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetHandleByIndex_v2 = dlsym(handle, 'nvmlDeviceGetHandleByIndex_v2')
global __nvmlDeviceGetHandleBySerial
__nvmlDeviceGetHandleBySerial = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleBySerial')
if __nvmlDeviceGetHandleBySerial == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetHandleBySerial = dlsym(handle, 'nvmlDeviceGetHandleBySerial')
global __nvmlDeviceGetHandleByUUID
__nvmlDeviceGetHandleByUUID = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUID')
if __nvmlDeviceGetHandleByUUID == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetHandleByUUID = dlsym(handle, 'nvmlDeviceGetHandleByUUID')
global __nvmlDeviceGetHandleByUUIDV
__nvmlDeviceGetHandleByUUIDV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUIDV')
if __nvmlDeviceGetHandleByUUIDV == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetHandleByUUIDV = dlsym(handle, 'nvmlDeviceGetHandleByUUIDV')
global __nvmlDeviceGetHandleByPciBusId_v2
__nvmlDeviceGetHandleByPciBusId_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByPciBusId_v2')
if __nvmlDeviceGetHandleByPciBusId_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetHandleByPciBusId_v2 = dlsym(handle, 'nvmlDeviceGetHandleByPciBusId_v2')
global __nvmlDeviceGetName
__nvmlDeviceGetName = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetName')
if __nvmlDeviceGetName == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetName = dlsym(handle, 'nvmlDeviceGetName')
global __nvmlDeviceGetBrand
__nvmlDeviceGetBrand = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBrand')
if __nvmlDeviceGetBrand == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetBrand = dlsym(handle, 'nvmlDeviceGetBrand')
global __nvmlDeviceGetIndex
__nvmlDeviceGetIndex = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetIndex')
if __nvmlDeviceGetIndex == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetIndex = dlsym(handle, 'nvmlDeviceGetIndex')
global __nvmlDeviceGetSerial
__nvmlDeviceGetSerial = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSerial')
if __nvmlDeviceGetSerial == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetSerial = dlsym(handle, 'nvmlDeviceGetSerial')
global __nvmlDeviceGetModuleId
__nvmlDeviceGetModuleId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetModuleId')
if __nvmlDeviceGetModuleId == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetModuleId = dlsym(handle, 'nvmlDeviceGetModuleId')
global __nvmlDeviceGetC2cModeInfoV
__nvmlDeviceGetC2cModeInfoV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetC2cModeInfoV')
if __nvmlDeviceGetC2cModeInfoV == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetC2cModeInfoV = dlsym(handle, 'nvmlDeviceGetC2cModeInfoV')
global __nvmlDeviceGetMemoryAffinity
__nvmlDeviceGetMemoryAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemoryAffinity')
if __nvmlDeviceGetMemoryAffinity == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMemoryAffinity = dlsym(handle, 'nvmlDeviceGetMemoryAffinity')
global __nvmlDeviceGetCpuAffinityWithinScope
__nvmlDeviceGetCpuAffinityWithinScope = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinityWithinScope')
if __nvmlDeviceGetCpuAffinityWithinScope == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCpuAffinityWithinScope = dlsym(handle, 'nvmlDeviceGetCpuAffinityWithinScope')
global __nvmlDeviceGetCpuAffinity
__nvmlDeviceGetCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinity')
if __nvmlDeviceGetCpuAffinity == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCpuAffinity = dlsym(handle, 'nvmlDeviceGetCpuAffinity')
global __nvmlDeviceSetCpuAffinity
__nvmlDeviceSetCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetCpuAffinity')
if __nvmlDeviceSetCpuAffinity == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceSetCpuAffinity = dlsym(handle, 'nvmlDeviceSetCpuAffinity')
global __nvmlDeviceClearCpuAffinity
__nvmlDeviceClearCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceClearCpuAffinity')
if __nvmlDeviceClearCpuAffinity == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceClearCpuAffinity = dlsym(handle, 'nvmlDeviceClearCpuAffinity')
global __nvmlDeviceGetNumaNodeId
__nvmlDeviceGetNumaNodeId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNumaNodeId')
if __nvmlDeviceGetNumaNodeId == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetNumaNodeId = dlsym(handle, 'nvmlDeviceGetNumaNodeId')
global __nvmlDeviceGetTopologyCommonAncestor
__nvmlDeviceGetTopologyCommonAncestor = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTopologyCommonAncestor')
if __nvmlDeviceGetTopologyCommonAncestor == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetTopologyCommonAncestor = dlsym(handle, 'nvmlDeviceGetTopologyCommonAncestor')
global __nvmlDeviceGetTopologyNearestGpus
__nvmlDeviceGetTopologyNearestGpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTopologyNearestGpus')
if __nvmlDeviceGetTopologyNearestGpus == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetTopologyNearestGpus = dlsym(handle, 'nvmlDeviceGetTopologyNearestGpus')
global __nvmlDeviceGetP2PStatus
__nvmlDeviceGetP2PStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetP2PStatus')
if __nvmlDeviceGetP2PStatus == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetP2PStatus = dlsym(handle, 'nvmlDeviceGetP2PStatus')
global __nvmlDeviceGetUUID
__nvmlDeviceGetUUID = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetUUID')
if __nvmlDeviceGetUUID == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetUUID = dlsym(handle, 'nvmlDeviceGetUUID')
global __nvmlDeviceGetMinorNumber
__nvmlDeviceGetMinorNumber = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMinorNumber')
if __nvmlDeviceGetMinorNumber == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMinorNumber = dlsym(handle, 'nvmlDeviceGetMinorNumber')
global __nvmlDeviceGetBoardPartNumber
__nvmlDeviceGetBoardPartNumber = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBoardPartNumber')
if __nvmlDeviceGetBoardPartNumber == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetBoardPartNumber = dlsym(handle, 'nvmlDeviceGetBoardPartNumber')
global __nvmlDeviceGetInforomVersion
__nvmlDeviceGetInforomVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomVersion')
if __nvmlDeviceGetInforomVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetInforomVersion = dlsym(handle, 'nvmlDeviceGetInforomVersion')
global __nvmlDeviceGetInforomImageVersion
__nvmlDeviceGetInforomImageVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomImageVersion')
if __nvmlDeviceGetInforomImageVersion == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetInforomImageVersion = dlsym(handle, 'nvmlDeviceGetInforomImageVersion')
global __nvmlDeviceGetInforomConfigurationChecksum
__nvmlDeviceGetInforomConfigurationChecksum = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomConfigurationChecksum')
if __nvmlDeviceGetInforomConfigurationChecksum == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetInforomConfigurationChecksum = dlsym(handle, 'nvmlDeviceGetInforomConfigurationChecksum')
global __nvmlDeviceValidateInforom
__nvmlDeviceValidateInforom = dlsym(RTLD_DEFAULT, 'nvmlDeviceValidateInforom')
if __nvmlDeviceValidateInforom == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceValidateInforom = dlsym(handle, 'nvmlDeviceValidateInforom')
global __nvmlDeviceGetLastBBXFlushTime
__nvmlDeviceGetLastBBXFlushTime = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetLastBBXFlushTime')
if __nvmlDeviceGetLastBBXFlushTime == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetLastBBXFlushTime = dlsym(handle, 'nvmlDeviceGetLastBBXFlushTime')
global __nvmlDeviceGetDisplayMode
__nvmlDeviceGetDisplayMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDisplayMode')
if __nvmlDeviceGetDisplayMode == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetDisplayMode = dlsym(handle, 'nvmlDeviceGetDisplayMode')
global __nvmlDeviceGetDisplayActive
__nvmlDeviceGetDisplayActive = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDisplayActive')
if __nvmlDeviceGetDisplayActive == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetDisplayActive = dlsym(handle, 'nvmlDeviceGetDisplayActive')
global __nvmlDeviceGetPersistenceMode
__nvmlDeviceGetPersistenceMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPersistenceMode')
if __nvmlDeviceGetPersistenceMode == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetPersistenceMode = dlsym(handle, 'nvmlDeviceGetPersistenceMode')
global __nvmlDeviceGetPciInfoExt
__nvmlDeviceGetPciInfoExt = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPciInfoExt')
if __nvmlDeviceGetPciInfoExt == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetPciInfoExt = dlsym(handle, 'nvmlDeviceGetPciInfoExt')
global __nvmlDeviceGetPciInfo_v3
__nvmlDeviceGetPciInfo_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPciInfo_v3')
if __nvmlDeviceGetPciInfo_v3 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetPciInfo_v3 = dlsym(handle, 'nvmlDeviceGetPciInfo_v3')
global __nvmlDeviceGetMaxPcieLinkGeneration
__nvmlDeviceGetMaxPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkGeneration')
if __nvmlDeviceGetMaxPcieLinkGeneration == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMaxPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetMaxPcieLinkGeneration')
global __nvmlDeviceGetGpuMaxPcieLinkGeneration
__nvmlDeviceGetGpuMaxPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuMaxPcieLinkGeneration')
if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetGpuMaxPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetGpuMaxPcieLinkGeneration')
global __nvmlDeviceGetMaxPcieLinkWidth
__nvmlDeviceGetMaxPcieLinkWidth = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkWidth')
if __nvmlDeviceGetMaxPcieLinkWidth == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMaxPcieLinkWidth = dlsym(handle, 'nvmlDeviceGetMaxPcieLinkWidth')
global __nvmlDeviceGetCurrPcieLinkGeneration
__nvmlDeviceGetCurrPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkGeneration')
if __nvmlDeviceGetCurrPcieLinkGeneration == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCurrPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetCurrPcieLinkGeneration')
global __nvmlDeviceGetCurrPcieLinkWidth
__nvmlDeviceGetCurrPcieLinkWidth = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkWidth')
if __nvmlDeviceGetCurrPcieLinkWidth == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCurrPcieLinkWidth = dlsym(handle, 'nvmlDeviceGetCurrPcieLinkWidth')
global __nvmlDeviceGetPcieThroughput
__nvmlDeviceGetPcieThroughput = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieThroughput')
if __nvmlDeviceGetPcieThroughput == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetPcieThroughput = dlsym(handle, 'nvmlDeviceGetPcieThroughput')
global __nvmlDeviceGetPcieReplayCounter
__nvmlDeviceGetPcieReplayCounter = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieReplayCounter')
if __nvmlDeviceGetPcieReplayCounter == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetPcieReplayCounter = dlsym(handle, 'nvmlDeviceGetPcieReplayCounter')
global __nvmlDeviceGetClockInfo
__nvmlDeviceGetClockInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClockInfo')
if __nvmlDeviceGetClockInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetClockInfo = dlsym(handle, 'nvmlDeviceGetClockInfo')
global __nvmlDeviceGetMaxClockInfo
__nvmlDeviceGetMaxClockInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxClockInfo')
if __nvmlDeviceGetMaxClockInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMaxClockInfo = dlsym(handle, 'nvmlDeviceGetMaxClockInfo')
global __nvmlDeviceGetGpcClkVfOffset
__nvmlDeviceGetGpcClkVfOffset = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpcClkVfOffset')
if __nvmlDeviceGetGpcClkVfOffset == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetGpcClkVfOffset = dlsym(handle, 'nvmlDeviceGetGpcClkVfOffset')
global __nvmlDeviceGetClock
__nvmlDeviceGetClock = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClock')
if __nvmlDeviceGetClock == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetClock = dlsym(handle, 'nvmlDeviceGetClock')
global __nvmlDeviceGetMaxCustomerBoostClock
__nvmlDeviceGetMaxCustomerBoostClock = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxCustomerBoostClock')
if __nvmlDeviceGetMaxCustomerBoostClock == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMaxCustomerBoostClock = dlsym(handle, 'nvmlDeviceGetMaxCustomerBoostClock')
global __nvmlDeviceGetSupportedMemoryClocks
__nvmlDeviceGetSupportedMemoryClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedMemoryClocks')
if __nvmlDeviceGetSupportedMemoryClocks == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetSupportedMemoryClocks = dlsym(handle, 'nvmlDeviceGetSupportedMemoryClocks')
global __nvmlDeviceGetSupportedGraphicsClocks
__nvmlDeviceGetSupportedGraphicsClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedGraphicsClocks')
if __nvmlDeviceGetSupportedGraphicsClocks == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetSupportedGraphicsClocks = dlsym(handle, 'nvmlDeviceGetSupportedGraphicsClocks')
global __nvmlDeviceGetAutoBoostedClocksEnabled
__nvmlDeviceGetAutoBoostedClocksEnabled = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAutoBoostedClocksEnabled')
if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetAutoBoostedClocksEnabled = dlsym(handle, 'nvmlDeviceGetAutoBoostedClocksEnabled')
global __nvmlDeviceGetFanSpeed
__nvmlDeviceGetFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed')
if __nvmlDeviceGetFanSpeed == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetFanSpeed = dlsym(handle, 'nvmlDeviceGetFanSpeed')
global __nvmlDeviceGetFanSpeed_v2
__nvmlDeviceGetFanSpeed_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed_v2')
if __nvmlDeviceGetFanSpeed_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetFanSpeed_v2 = dlsym(handle, 'nvmlDeviceGetFanSpeed_v2')
global __nvmlDeviceGetFanSpeedRPM
__nvmlDeviceGetFanSpeedRPM = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeedRPM')
if __nvmlDeviceGetFanSpeedRPM == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetFanSpeedRPM = dlsym(handle, 'nvmlDeviceGetFanSpeedRPM')
global __nvmlDeviceGetTargetFanSpeed
__nvmlDeviceGetTargetFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTargetFanSpeed')
if __nvmlDeviceGetTargetFanSpeed == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetTargetFanSpeed = dlsym(handle, 'nvmlDeviceGetTargetFanSpeed')
global __nvmlDeviceGetMinMaxFanSpeed
__nvmlDeviceGetMinMaxFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMinMaxFanSpeed')
if __nvmlDeviceGetMinMaxFanSpeed == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMinMaxFanSpeed = dlsym(handle, 'nvmlDeviceGetMinMaxFanSpeed')
global __nvmlDeviceGetFanControlPolicy_v2
__nvmlDeviceGetFanControlPolicy_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanControlPolicy_v2')
if __nvmlDeviceGetFanControlPolicy_v2 == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetFanControlPolicy_v2 = dlsym(handle, 'nvmlDeviceGetFanControlPolicy_v2')
global __nvmlDeviceGetNumFans
__nvmlDeviceGetNumFans = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNumFans')
if __nvmlDeviceGetNumFans == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetNumFans = dlsym(handle, 'nvmlDeviceGetNumFans')
global __nvmlDeviceGetCoolerInfo
__nvmlDeviceGetCoolerInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCoolerInfo')
if __nvmlDeviceGetCoolerInfo == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetCoolerInfo = dlsym(handle, 'nvmlDeviceGetCoolerInfo')
global __nvmlDeviceGetTemperatureV
__nvmlDeviceGetTemperatureV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTemperatureV')
if __nvmlDeviceGetTemperatureV == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetTemperatureV = dlsym(handle, 'nvmlDeviceGetTemperatureV')
global __nvmlDeviceGetTemperatureThreshold
__nvmlDeviceGetTemperatureThreshold = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTemperatureThreshold')
if __nvmlDeviceGetTemperatureThreshold == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetTemperatureThreshold = dlsym(handle, 'nvmlDeviceGetTemperatureThreshold')
global __nvmlDeviceGetMarginTemperature
__nvmlDeviceGetMarginTemperature = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMarginTemperature')
if __nvmlDeviceGetMarginTemperature == NULL:
if handle == NULL:
handle = load_library()
__nvmlDeviceGetMarginTemperature = dlsym(handle, 'nvmlDeviceGetMarginTemperature')
global __nvmlDeviceGetThermalSettings
__nvmlDeviceGetThermalSettings = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetThermalSettings')
if __nvmlDeviceGetThermalSettings == NULL: