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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
|
// Generated automatically by zluda_bindgen
// DO NOT EDIT MANUALLY
#![allow(warnings)]
extern "system" {
#[must_use]
/** Initialize NVML, but don't initialize any GPUs yet.
\note nvmlInit_v3 introduces a "flags" argument, that allows passing boolean values
modifying the behaviour of nvmlInit().
\note In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit"_v1" (default in NVML 4.304 and older) that
did initialize all GPU devices in the system.
This allows NVML to communicate with a GPU
when other GPUs in the system are unstable or in a bad state. When using this API, GPUs are
discovered and initialized in nvmlDeviceGetHandleBy* functions instead.
\note To contrast nvmlInit_v2 with nvmlInit"_v1", NVML 4.304 nvmlInit"_v1" will fail when any detected GPU is in
a bad or unstable state.
For all products.
This method, should be called once before invoking any other methods in the library.
A reference count of the number of initializations is maintained. Shutdown only occurs
when the reference count reaches zero.
@return
- \ref NVML_SUCCESS if NVML has been properly initialized
- \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running
- \ref NVML_ERROR_NO_PERMISSION if NVML does not have permission to talk to the driver
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlInit_v2() -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** nvmlInitWithFlags is a variant of nvmlInit(), that allows passing a set of boolean values
modifying the behaviour of nvmlInit().
Other than the "flags" parameter it is completely similar to \ref nvmlInit_v2.
For all products.
@param flags behaviour modifier flags
@return
- \ref NVML_SUCCESS if NVML has been properly initialized
- \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running
- \ref NVML_ERROR_NO_PERMISSION if NVML does not have permission to talk to the driver
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlInitWithFlags(flags: ::core::ffi::c_uint) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Shut down NVML by releasing all GPU resources previously allocated with \ref nvmlInit_v2().
For all products.
This method should be called after NVML work is done, once for each call to \ref nvmlInit_v2()
A reference count of the number of initializations is maintained. Shutdown only occurs
when the reference count reaches zero. For backwards compatibility, no error is reported if
nvmlShutdown() is called more times than nvmlInit().
@return
- \ref NVML_SUCCESS if NVML has been properly shut down
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlShutdown() -> cuda_types::nvml::nvmlReturn_t;
/** Helper method for converting NVML error codes into readable strings.
For all products.
@param result NVML error code to convert
@return String representation of the error.
*/
fn nvmlErrorString(
result: cuda_types::nvml::nvmlReturn_t,
) -> *const ::core::ffi::c_char;
#[must_use]
/** Retrieves the version of the system's graphics driver.
For all products.
The version identifier is an alphanumeric string. It will not exceed 80 characters in length
(including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE.
@param version Reference in which to return the version identifier
@param length The maximum allowed length of the string returned in \a version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small*/
fn nvmlSystemGetDriverVersion(
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the version of the NVML library.
For all products.
The version identifier is an alphanumeric string. It will not exceed 80 characters in length
(including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE.
@param version Reference in which to return the version identifier
@param length The maximum allowed length of the string returned in \a version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small*/
fn nvmlSystemGetNVMLVersion(
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the version of the CUDA driver.
For all products.
The CUDA driver version returned will be retreived from the currently installed version of CUDA.
If the cuda library is not found, this function will return a known supported version number.
@param cudaDriverVersion Reference in which to return the version identifier
@return
- \ref NVML_SUCCESS if \a cudaDriverVersion has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a cudaDriverVersion is NULL*/
fn nvmlSystemGetCudaDriverVersion(
cudaDriverVersion: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the version of the CUDA driver from the shared library.
For all products.
The returned CUDA driver version by calling cuDriverGetVersion()
@param cudaDriverVersion Reference in which to return the version identifier
@return
- \ref NVML_SUCCESS if \a cudaDriverVersion has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a cudaDriverVersion is NULL
- \ref NVML_ERROR_LIBRARY_NOT_FOUND if \a libcuda.so.1 or libcuda.dll is not found
- \ref NVML_ERROR_FUNCTION_NOT_FOUND if \a cuDriverGetVersion() is not found in the shared library*/
fn nvmlSystemGetCudaDriverVersion_v2(
cudaDriverVersion: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets name of the process with provided process id
For all products.
Returned process name is cropped to provided length.
name string is encoded in ANSI.
@param pid The identifier of the process
@param name Reference in which to return the process name
@param length The maximum allowed length of the string returned in \a name
@return
- \ref NVML_SUCCESS if \a name has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a name is NULL or \a length is 0.
- \ref NVML_ERROR_NOT_FOUND if process doesn't exists
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlSystemGetProcessName(
pid: ::core::ffi::c_uint,
name: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system.
For S-class products.
The \a hwbcCount argument is expected to be set to the size of the input \a hwbcEntries array.
The HIC must be connected to an S-class system for it to be reported by this function.
@param hwbcCount Size of hwbcEntries array
@param hwbcEntries Array holding information about hwbc
@return
- \ref NVML_SUCCESS if \a hwbcCount and \a hwbcEntries have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if either \a hwbcCount or \a hwbcEntries is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a hwbcCount indicates that the \a hwbcEntries array is too small*/
fn nvmlSystemGetHicVersion(
hwbcCount: *mut ::core::ffi::c_uint,
hwbcEntries: *mut cuda_types::nvml::nvmlHwbcEntry_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the set of GPUs that have a CPU affinity with the given CPU number
For all products.
Supported on Linux only.
@param cpuNumber The CPU number
@param count When zero, is set to the number of matching GPUs such that \a deviceArray
can be malloc'd. When non-zero, \a deviceArray will be filled with \a count
number of device handles.
@param deviceArray An array of device handles for GPUs found with affinity to \a cpuNumber
@return
- \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
- \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature
- \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery*/
fn nvmlSystemGetTopologyGpuSet(
cpuNumber: ::core::ffi::c_uint,
count: *mut ::core::ffi::c_uint,
deviceArray: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the number of units in the system.
For S-class products.
@param unitCount Reference in which to return the number of units
@return
- \ref NVML_SUCCESS if \a unitCount has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unitCount is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetCount(
unitCount: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the handle for a particular unit, based on its index.
For S-class products.
Valid indices are derived from the \a unitCount returned by \ref nvmlUnitGetCount().
For example, if \a unitCount is 2 the valid indices are 0 and 1, corresponding to UNIT 0 and UNIT 1.
The order in which NVML enumerates units has no guarantees of consistency between reboots.
@param index The index of the target unit, >= 0 and < \a unitCount
@param unit Reference in which to return the unit handle
@return
- \ref NVML_SUCCESS if \a unit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a unit is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetHandleByIndex(
index: ::core::ffi::c_uint,
unit: *mut cuda_types::nvml::nvmlUnit_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the static information associated with a unit.
For S-class products.
See \ref nvmlUnitInfo_t for details on available unit info.
@param unit The identifier of the target unit
@param info Reference in which to return the unit information
@return
- \ref NVML_SUCCESS if \a info has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a info is NULL*/
fn nvmlUnitGetUnitInfo(
unit: cuda_types::nvml::nvmlUnit_t,
info: *mut cuda_types::nvml::nvmlUnitInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the LED state associated with this unit.
For S-class products.
See \ref nvmlLedState_t for details on allowed states.
@param unit The identifier of the target unit
@param state Reference in which to return the current LED state
@return
- \ref NVML_SUCCESS if \a state has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a state is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlUnitSetLedState()*/
fn nvmlUnitGetLedState(
unit: cuda_types::nvml::nvmlUnit_t,
state: *mut cuda_types::nvml::nvmlLedState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the PSU stats for the unit.
For S-class products.
See \ref nvmlPSUInfo_t for details on available PSU info.
@param unit The identifier of the target unit
@param psu Reference in which to return the PSU information
@return
- \ref NVML_SUCCESS if \a psu has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a psu is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetPsuInfo(
unit: cuda_types::nvml::nvmlUnit_t,
psu: *mut cuda_types::nvml::nvmlPSUInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the temperature readings for the unit, in degrees C.
For S-class products.
Depending on the product, readings may be available for intake (type=0),
exhaust (type=1) and board (type=2).
@param unit The identifier of the target unit
@param type The type of reading to take
@param temp Reference in which to return the intake temperature
@return
- \ref NVML_SUCCESS if \a temp has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a type is invalid or \a temp is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetTemperature(
unit: cuda_types::nvml::nvmlUnit_t,
type_: ::core::ffi::c_uint,
temp: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the fan speed readings for the unit.
For S-class products.
See \ref nvmlUnitFanSpeeds_t for details on available fan speed info.
@param unit The identifier of the target unit
@param fanSpeeds Reference in which to return the fan speed information
@return
- \ref NVML_SUCCESS if \a fanSpeeds has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a fanSpeeds is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetFanSpeedInfo(
unit: cuda_types::nvml::nvmlUnit_t,
fanSpeeds: *mut cuda_types::nvml::nvmlUnitFanSpeeds_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the set of GPU devices that are attached to the specified unit.
For S-class products.
The \a deviceCount argument is expected to be set to the size of the input \a devices array.
@param unit The identifier of the target unit
@param deviceCount Reference in which to provide the \a devices array size, and
to return the number of attached GPU devices
@param devices Reference in which to return the references to the attached GPU devices
@return
- \ref NVML_SUCCESS if \a deviceCount and \a devices have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a deviceCount indicates that the \a devices array is too small
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid, either of \a deviceCount or \a devices is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlUnitGetDevices(
unit: cuda_types::nvml::nvmlUnit_t,
deviceCount: *mut ::core::ffi::c_uint,
devices: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the number of compute devices in the system. A compute device is a single GPU.
For all products.
Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
Update your code to handle this error, or use NVML 4.304 or older nvml header file.
For backward binary compatibility reasons _v1 version of the API is still present in the shared
library.
Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
@param deviceCount Reference in which to return the number of accessible devices
@return
- \ref NVML_SUCCESS if \a deviceCount has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCount_v2(
deviceCount: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get attributes (engine counts etc.) for the given NVML device handle.
@note This API currently only supports MIG device handles.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device NVML device handle
@param attributes Device attributes
@return
- \ref NVML_SUCCESS if \a device attributes were successfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle is invalid
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetAttributes_v2(
device: cuda_types::nvml::nvmlDevice_t,
attributes: *mut cuda_types::nvml::nvmlDeviceAttributes_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the handle for a particular device, based on its index.
For all products.
Valid indices are derived from the \a accessibleDevices count returned by
\ref nvmlDeviceGetCount_v2(). For example, if \a accessibleDevices is 2 the valid indices
are 0 and 1, corresponding to GPU 0 and GPU 1.
The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
is recommended that devices be looked up by their PCI ids or UUID. See
\ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId_v2().
Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
Starting from NVML 5, this API causes NVML to initialize the target GPU
NVML may initialize additional GPUs if:
- The target GPU is an SLI slave
Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system
even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device.
Update your code to handle this error, or use NVML 4.304 or older nvml header file.
For backward binary compatibility reasons _v1 version of the API is still present in the shared
library.
Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index.
If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't
need to worry about that.
@param index The index of the target GPU, >= 0 and < \a accessibleDevices
@param device Reference in which to return the device handle
@return
- \ref NVML_SUCCESS if \a device has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a device is NULL
- \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device
- \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetIndex
@see nvmlDeviceGetCount*/
fn nvmlDeviceGetHandleByIndex_v2(
index: ::core::ffi::c_uint,
device: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the handle for a particular device, based on its board serial number.
For Fermi &tm; or newer fully supported devices.
This number corresponds to the value printed directly on the board, and to the value returned by
\ref nvmlDeviceGetSerial().
@deprecated Since more than one GPU can exist on a single board this function is deprecated in favor
of \ref nvmlDeviceGetHandleByUUID.
For dual GPU boards this function will return NVML_ERROR_INVALID_ARGUMENT.
Starting from NVML 5, this API causes NVML to initialize the target GPU
NVML may initialize additional GPUs as it searches for the target GPU
@param serial The board serial number of the target GPU
@param device Reference in which to return the device handle
@return
- \ref NVML_SUCCESS if \a device has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a serial is invalid, \a device is NULL or more than one
device has the same serial (dual GPU boards)
- \ref NVML_ERROR_NOT_FOUND if \a serial does not match a valid device on the system
- \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
- \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs
- \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetSerial
@see nvmlDeviceGetHandleByUUID*/
fn nvmlDeviceGetHandleBySerial(
serial: *const ::core::ffi::c_char,
device: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the handle for a particular device, based on its globally unique immutable UUID associated with each device.
For all products.
@param uuid The UUID of the target GPU or MIG instance
@param device Reference in which to return the device handle or MIG device handle
Starting from NVML 5, this API causes NVML to initialize the target GPU
NVML may initialize additional GPUs as it searches for the target GPU
@return
- \ref NVML_SUCCESS if \a device has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a uuid is invalid or \a device is null
- \ref NVML_ERROR_NOT_FOUND if \a uuid does not match a valid device on the system
- \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables
- \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs
- \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetUUID*/
fn nvmlDeviceGetHandleByUUID(
uuid: *const ::core::ffi::c_char,
device: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the handle for a particular device, based on its PCI bus id.
For all products.
This value corresponds to the nvmlPciInfo_t::busId returned by \ref nvmlDeviceGetPciInfo_v3().
Starting from NVML 5, this API causes NVML to initialize the target GPU
NVML may initialize additional GPUs if:
- The target GPU is an SLI slave
\note NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND
instead of NVML_ERROR_NO_PERMISSION.
@param pciBusId The PCI bus id of the target GPU
@param device Reference in which to return the device handle
@return
- \ref NVML_SUCCESS if \a device has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pciBusId is invalid or \a device is NULL
- \ref NVML_ERROR_NOT_FOUND if \a pciBusId does not match a valid device on the system
- \ref NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly attached external power cables
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device
- \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetHandleByPciBusId_v2(
pciBusId: *const ::core::ffi::c_char,
device: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the name of this device.
For all products.
The name is an alphanumeric string that denotes a particular product, e.g. Tesla &tm; C2070. It will not
exceed 96 characters in length (including the NULL terminator). See \ref
nvmlConstants::NVML_DEVICE_NAME_V2_BUFFER_SIZE.
When used with MIG device handles the API returns MIG device names which can be used to identify devices
based on their attributes.
@param device The identifier of the target device
@param name Reference in which to return the product name
@param length The maximum allowed length of the string returned in \a name
@return
- \ref NVML_SUCCESS if \a name has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a name is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetName(
device: cuda_types::nvml::nvmlDevice_t,
name: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the brand of this device.
For all products.
The type is a member of \ref nvmlBrandType_t defined above.
@param device The identifier of the target device
@param type Reference in which to return the product brand type
@return
- \ref NVML_SUCCESS if \a name has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a type is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetBrand(
device: cuda_types::nvml::nvmlDevice_t,
type_: *mut cuda_types::nvml::nvmlBrandType_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the NVML index of this device.
For all products.
Valid indices are derived from the \a accessibleDevices count returned by
\ref nvmlDeviceGetCount_v2(). For example, if \a accessibleDevices is 2 the valid indices
are 0 and 1, corresponding to GPU 0 and GPU 1.
The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it
is recommended that devices be looked up by their PCI ids or GPU UUID. See
\ref nvmlDeviceGetHandleByPciBusId_v2() and \ref nvmlDeviceGetHandleByUUID().
When used with MIG device handles this API returns indices that can be
passed to \ref nvmlDeviceGetMigDeviceHandleByIndex to retrieve an identical handle.
MIG device indices are unique within a device.
Note: The NVML index may not correlate with other APIs, such as the CUDA device index.
@param device The identifier of the target device
@param index Reference in which to return the NVML index of the device
@return
- \ref NVML_SUCCESS if \a index has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a index is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetHandleByIndex()
@see nvmlDeviceGetCount()*/
fn nvmlDeviceGetIndex(
device: cuda_types::nvml::nvmlDevice_t,
index: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the globally unique board serial number associated with this device's board.
For all products with an inforom.
The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator).
This number matches the serial number tag that is physically attached to the board. See \ref
nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE.
@param device The identifier of the target device
@param serial Reference in which to return the board/module serial number
@param length The maximum allowed length of the string returned in \a serial
@return
- \ref NVML_SUCCESS if \a serial has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a serial is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetSerial(
device: cuda_types::nvml::nvmlDevice_t,
serial: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
fn nvmlDeviceGetModuleId(
device: cuda_types::nvml::nvmlDevice_t,
moduleId: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the Device's C2C Mode information
@param device The identifier of the target device
@param c2cModeInfo Output struct containing the device's C2C Mode info
@return
- \ref NVML_SUCCESS if \a C2C Mode Infor query is successful
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a serial is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetC2cModeInfoV(
device: cuda_types::nvml::nvmlDevice_t,
c2cModeInfo: *mut cuda_types::nvml::nvmlC2cModeInfo_v1_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves an array of unsigned ints (sized to nodeSetSize) of bitmasks with
the ideal memory affinity within node or socket for the device.
For example, if NUMA node 0, 1 are ideal within the socket for the device and nodeSetSize == 1,
result[0] = 0x3
\note If requested scope is not applicable to the target topology, the API
will fall back to reporting the memory affinity for the immediate non-I/O
ancestor of the device.
For Kepler &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@param nodeSetSize The size of the nodeSet array that is safe to access
@param nodeSet Array reference in which to return a bitmask of NODEs, 64 NODEs per
unsigned long on 64-bit machines, 32 on 32-bit machines
@param scope Scope that change the default behavior
@return
- \ref NVML_SUCCESS if \a NUMA node Affinity has been filled
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, nodeSetSize == 0, nodeSet is NULL or scope is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMemoryAffinity(
device: cuda_types::nvml::nvmlDevice_t,
nodeSetSize: ::core::ffi::c_uint,
nodeSet: *mut ::core::ffi::c_ulong,
scope: cuda_types::nvml::nvmlAffinityScope_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the
ideal CPU affinity within node or socket for the device.
For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2,
result[0] = 0x3, result[1] = 0x3
\note If requested scope is not applicable to the target topology, the API
will fall back to reporting the CPU affinity for the immediate non-I/O
ancestor of the device.
For Kepler &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@param cpuSetSize The size of the cpuSet array that is safe to access
@param cpuSet Array reference in which to return a bitmask of CPUs, 64 CPUs per
unsigned long on 64-bit machines, 32 on 32-bit machines
@param scope Scope that change the default behavior
@return
- \ref NVML_SUCCESS if \a cpuAffinity has been filled
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, cpuSetSize == 0, cpuSet is NULL or sope is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCpuAffinityWithinScope(
device: cuda_types::nvml::nvmlDevice_t,
cpuSetSize: ::core::ffi::c_uint,
cpuSet: *mut ::core::ffi::c_ulong,
scope: cuda_types::nvml::nvmlAffinityScope_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device
For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2,
result[0] = 0x3, result[1] = 0x3
This is equivalent to calling \ref nvmlDeviceGetCpuAffinityWithinScope with \ref NVML_AFFINITY_SCOPE_NODE.
For Kepler &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@param cpuSetSize The size of the cpuSet array that is safe to access
@param cpuSet Array reference in which to return a bitmask of CPUs, 64 CPUs per
unsigned long on 64-bit machines, 32 on 32-bit machines
@return
- \ref NVML_SUCCESS if \a cpuAffinity has been filled
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, cpuSetSize == 0, or cpuSet is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCpuAffinity(
device: cuda_types::nvml::nvmlDevice_t,
cpuSetSize: ::core::ffi::c_uint,
cpuSet: *mut ::core::ffi::c_ulong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets the ideal affinity for the calling thread and device using the guidelines
given in nvmlDeviceGetCpuAffinity(). Note, this is a change as of version 8.0.
Older versions set the affinity for a calling process and all children.
Currently supports up to 1024 processors.
For Kepler &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if the calling process has been successfully bound
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetCpuAffinity(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Clear all affinity bindings for the calling thread. Note, this is a change as of version
8.0 as older versions cleared the affinity for a calling process and all children.
For Kepler &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if the calling process has been successfully unbound
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceClearCpuAffinity(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the NUMA node of the given GPU device.
This only applies to platforms where the GPUs are NUMA nodes.
@param[in] device The device handle
@param[out] node NUMA node ID of the device
@returns
- \ref NVML_SUCCESS if the NUMA node is retrieved successfully
- \ref NVML_ERROR_NOT_SUPPORTED if request is not supported on the current platform
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device \a node is invalid*/
fn nvmlDeviceGetNumaNodeId(
device: cuda_types::nvml::nvmlDevice_t,
node: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/// @}
fn nvmlDeviceGetTopologyCommonAncestor(
device1: cuda_types::nvml::nvmlDevice_t,
device2: cuda_types::nvml::nvmlDevice_t,
pathInfo: *mut cuda_types::nvml::nvmlGpuTopologyLevel_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level
For all products.
Supported on Linux only.
@param device The identifier of the first device
@param level The \ref nvmlGpuTopologyLevel_t level to search for other GPUs
@param count When zero, is set to the number of matching GPUs such that \a deviceArray
can be malloc'd. When non-zero, \a deviceArray will be filled with \a count
number of device handles.
@param deviceArray An array of device handles for GPUs found at \a level
@return
- \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a level, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count
- \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature
- \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery*/
fn nvmlDeviceGetTopologyNearestGpus(
device: cuda_types::nvml::nvmlDevice_t,
level: cuda_types::nvml::nvmlGpuTopologyLevel_t,
count: *mut ::core::ffi::c_uint,
deviceArray: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the status for a given p2p capability index between a given pair of GPU
@param device1 The first device
@param device2 The second device
@param p2pIndex p2p Capability Index being looked for between \a device1 and \a device2
@param p2pStatus Reference in which to return the status of the \a p2pIndex
between \a device1 and \a device2
@return
- \ref NVML_SUCCESS if \a p2pStatus has been populated
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device1 or \a device2 or \a p2pIndex is invalid or \a p2pStatus is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetP2PStatus(
device1: cuda_types::nvml::nvmlDevice_t,
device2: cuda_types::nvml::nvmlDevice_t,
p2pIndex: cuda_types::nvml::nvmlGpuP2PCapsIndex_t,
p2pStatus: *mut cuda_types::nvml::nvmlGpuP2PStatus_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string,
that augments the immutable, board serial identifier.
For all products.
The UUID is a globally unique identifier. It is the only available identifier for pre-Fermi-architecture products.
It does NOT correspond to any identifier printed on the board. It will not exceed 96 characters in length
(including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_UUID_V2_BUFFER_SIZE.
When used with MIG device handles the API returns globally unique UUIDs which can be used to identify MIG
devices across both GPU and MIG devices. UUIDs are immutable for the lifetime of a MIG device.
@param device The identifier of the target device
@param uuid Reference in which to return the GPU UUID
@param length The maximum allowed length of the string returned in \a uuid
@return
- \ref NVML_SUCCESS if \a uuid has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a uuid is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetUUID(
device: cuda_types::nvml::nvmlDevice_t,
uuid: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for
each GPU will have the form /dev/nvidia[minor number].
For all products.
Supported only for Linux
@param device The identifier of the target device
@param minorNumber Reference in which to return the minor number for the device
@return
- \ref NVML_SUCCESS if the minor number is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minorNumber is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMinorNumber(
device: cuda_types::nvml::nvmlDevice_t,
minorNumber: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the the device board part number which is programmed into the board's InfoROM
For all products.
@param device Identifier of the target device
@param partNumber Reference to the buffer to return
@param length Length of the buffer reference
@return
- \ref NVML_SUCCESS if \a partNumber has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_SUPPORTED if the needed VBIOS fields have not been filled
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a serial is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetBoardPartNumber(
device: cuda_types::nvml::nvmlDevice_t,
partNumber: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the version information for the device's infoROM object.
For all products with an inforom.
Fermi and higher parts have non-volatile on-board memory for persisting device info, such as aggregate
ECC counts. The version of the data structures in this memory may change from time to time. It will not
exceed 16 characters in length (including the NULL terminator).
See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
See \ref nvmlInforomObject_t for details on the available infoROM objects.
@param device The identifier of the target device
@param object The target infoROM object
@param version Reference in which to return the infoROM version
@param length The maximum allowed length of the string returned in \a version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetInforomImageVersion*/
fn nvmlDeviceGetInforomVersion(
device: cuda_types::nvml::nvmlDevice_t,
object: cuda_types::nvml::nvmlInforomObject_t,
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the global infoROM image version
For all products with an inforom.
Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board
in contrast to infoROM object version which is only an indicator of supported features.
Version string will not exceed 16 characters in length (including the NULL terminator).
See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
@param device The identifier of the target device
@param version Reference in which to return the infoROM image version
@param length The maximum allowed length of the string returned in \a version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetInforomVersion*/
fn nvmlDeviceGetInforomImageVersion(
device: cuda_types::nvml::nvmlDevice_t,
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the checksum of the configuration stored in the device's infoROM.
For all products with an inforom.
Can be used to make sure that two GPUs have the exact same configuration.
Current checksum takes into account configuration stored in PWR and ECC infoROM objects.
Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC)
@param device The identifier of the target device
@param checksum Reference in which to return the infoROM configuration checksum
@return
- \ref NVML_SUCCESS if \a checksum has been set
- \ref NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be retrieved due to infoROM corruption
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a checksum is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetInforomConfigurationChecksum(
device: cuda_types::nvml::nvmlDevice_t,
checksum: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Reads the infoROM from the flash and verifies the checksums.
For all products with an inforom.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if infoROM is not corrupted
- \ref NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceValidateInforom(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the timestamp and the duration of the last flush of the BBX (blackbox) infoROM object during the current run.
For all products with an inforom.
@param device The identifier of the target device
@param timestamp The start timestamp of the last BBX Flush
@param durationUs The duration (us) of the last BBX Flush
@return
- \ref NVML_SUCCESS if \a timestamp and \a durationUs are successfully retrieved
- \ref NVML_ERROR_NOT_READY if the BBX object has not been flushed yet
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetInforomVersion*/
fn nvmlDeviceGetLastBBXFlushTime(
device: cuda_types::nvml::nvmlDevice_t,
timestamp: *mut ::core::ffi::c_ulonglong,
durationUs: *mut ::core::ffi::c_ulong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the display mode for the device.
For all products.
This method indicates whether a physical display (e.g. monitor) is currently connected to
any of the device's connectors.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param display Reference in which to return the display mode
@return
- \ref NVML_SUCCESS if \a display has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a display is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetDisplayMode(
device: cuda_types::nvml::nvmlDevice_t,
display: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the display active state for the device.
For all products.
This method indicates whether a display is initialized on the device.
For example whether X Server is attached to this device and has allocated memory for the screen.
Display can be active even when no monitor is physically attached.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param isActive Reference in which to return the display active state
@return
- \ref NVML_SUCCESS if \a isActive has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isActive is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetDisplayActive(
device: cuda_types::nvml::nvmlDevice_t,
isActive: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the persistence mode associated with this device.
For all products.
For Linux only.
When driver persistence mode is enabled the driver software state is not torn down when the last
client disconnects. By default this feature is disabled.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param mode Reference in which to return the current driver persistence mode
@return
- \ref NVML_SUCCESS if \a mode has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetPersistenceMode()*/
fn nvmlDeviceGetPersistenceMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves PCI attributes of this device.
For all products.
See \ref nvmlPciInfoExt_t for details on the available PCI info.
@param device The identifier of the target device
@param pci Reference in which to return the PCI info
@return
- \ref NVML_SUCCESS if \a pci has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPciInfoExt(
device: cuda_types::nvml::nvmlDevice_t,
pci: *mut cuda_types::nvml::nvmlPciInfoExt_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the PCI attributes of this device.
For all products.
See \ref nvmlPciInfo_t for details on the available PCI info.
@param device The identifier of the target device
@param pci Reference in which to return the PCI info
@return
- \ref NVML_SUCCESS if \a pci has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPciInfo_v3(
device: cuda_types::nvml::nvmlDevice_t,
pci: *mut cuda_types::nvml::nvmlPciInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the maximum PCIe link generation possible with this device and system
I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will
report is generation 1.
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param maxLinkGen Reference in which to return the max PCIe link generation
@return
- \ref NVML_SUCCESS if \a maxLinkGen has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkGen is null
- \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMaxPcieLinkGeneration(
device: cuda_types::nvml::nvmlDevice_t,
maxLinkGen: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the maximum PCIe link generation supported by this device
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param maxLinkGenDevice Reference in which to return the max PCIe link generation
@return
- \ref NVML_SUCCESS if \a maxLinkGenDevice has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkGenDevice is null
- \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGpuMaxPcieLinkGeneration(
device: cuda_types::nvml::nvmlDevice_t,
maxLinkGenDevice: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the maximum PCIe link width possible with this device and system
I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report
a max link width of 8.
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param maxLinkWidth Reference in which to return the max PCIe link generation
@return
- \ref NVML_SUCCESS if \a maxLinkWidth has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkWidth is null
- \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMaxPcieLinkWidth(
device: cuda_types::nvml::nvmlDevice_t,
maxLinkWidth: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current PCIe link generation
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param currLinkGen Reference in which to return the current PCIe link generation
@return
- \ref NVML_SUCCESS if \a currLinkGen has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkGen is null
- \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCurrPcieLinkGeneration(
device: cuda_types::nvml::nvmlDevice_t,
currLinkGen: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current PCIe link width
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param currLinkWidth Reference in which to return the current PCIe link generation
@return
- \ref NVML_SUCCESS if \a currLinkWidth has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkWidth is null
- \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCurrPcieLinkWidth(
device: cuda_types::nvml::nvmlDevice_t,
currLinkWidth: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve PCIe utilization information.
This function is querying a byte counter over a 20ms interval and thus is the
PCIe throughput over that interval.
For Maxwell &tm; or newer fully supported devices.
This method is not supported in virtual machines running virtual GPU (vGPU).
@param device The identifier of the target device
@param counter The specific counter that should be queried \ref nvmlPcieUtilCounter_t
@param value Reference in which to return throughput in KB/s
@return
- \ref NVML_SUCCESS if \a value has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a counter is invalid, or \a value is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPcieThroughput(
device: cuda_types::nvml::nvmlDevice_t,
counter: cuda_types::nvml::nvmlPcieUtilCounter_t,
value: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the PCIe replay counter.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param value Reference in which to return the counter's value
@return
- \ref NVML_SUCCESS if \a value has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a value is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPcieReplayCounter(
device: cuda_types::nvml::nvmlDevice_t,
value: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current clock speeds for the device.
For Fermi &tm; or newer fully supported devices.
See \ref nvmlClockType_t for details on available clock information.
@param device The identifier of the target device
@param type Identify which clock domain to query
@param clock Reference in which to return the clock speed in MHz
@return
- \ref NVML_SUCCESS if \a clock has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetClockInfo(
device: cuda_types::nvml::nvmlDevice_t,
type_: cuda_types::nvml::nvmlClockType_t,
clock: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the maximum clock speeds for the device.
For Fermi &tm; or newer fully supported devices.
See \ref nvmlClockType_t for details on available clock information.
\note On GPUs from Fermi family current P0 clocks (reported by \ref nvmlDeviceGetClockInfo) can differ from max clocks
by few MHz.
@param device The identifier of the target device
@param type Identify which clock domain to query
@param clock Reference in which to return the clock speed in MHz
@return
- \ref NVML_SUCCESS if \a clock has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMaxClockInfo(
device: cuda_types::nvml::nvmlDevice_t,
type_: cuda_types::nvml::nvmlClockType_t,
clock: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the GPCCLK VF offset value
@param[in] device The identifier of the target device
@param[out] offset The retrieved GPCCLK VF offset value
@return
- \ref NVML_SUCCESS if \a offset has been successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGpcClkVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
offset: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current setting of a clock that applications will use unless an overspec situation occurs.
Can be changed using \ref nvmlDeviceSetApplicationsClocks.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param clockType Identify which clock domain to query
@param clockMHz Reference in which to return the clock in MHz
@return
- \ref NVML_SUCCESS if \a clockMHz has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetApplicationsClock(
device: cuda_types::nvml::nvmlDevice_t,
clockType: cuda_types::nvml::nvmlClockType_t,
clockMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the default applications clock that GPU boots with or
defaults to after \ref nvmlDeviceResetApplicationsClocks call.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param clockType Identify which clock domain to query
@param clockMHz Reference in which to return the default clock in MHz
@return
- \ref NVML_SUCCESS if \a clockMHz has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
\see nvmlDeviceGetApplicationsClock*/
fn nvmlDeviceGetDefaultApplicationsClock(
device: cuda_types::nvml::nvmlDevice_t,
clockType: cuda_types::nvml::nvmlClockType_t,
clockMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the clock speed for the clock specified by the clock type and clock ID.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param clockType Identify which clock domain to query
@param clockId Identify which clock in the domain to query
@param clockMHz Reference in which to return the clock in MHz
@return
- \ref NVML_SUCCESS if \a clockMHz has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetClock(
device: cuda_types::nvml::nvmlDevice_t,
clockType: cuda_types::nvml::nvmlClockType_t,
clockId: cuda_types::nvml::nvmlClockId_t,
clockMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the customer defined maximum boost clock speed specified by the given clock type.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param clockType Identify which clock domain to query
@param clockMHz Reference in which to return the clock in MHz
@return
- \ref NVML_SUCCESS if \a clockMHz has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device or the \a clockType on this device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMaxCustomerBoostClock(
device: cuda_types::nvml::nvmlDevice_t,
clockType: cuda_types::nvml::nvmlClockType_t,
clockMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param count Reference in which to provide the \a clocksMHz array size, and
to return the number of elements
@param clocksMHz Reference in which to return the clock in MHz
@return
- \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to the number of
required elements)
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetApplicationsClocks
@see nvmlDeviceGetSupportedGraphicsClocks*/
fn nvmlDeviceGetSupportedMemoryClocks(
device: cuda_types::nvml::nvmlDevice_t,
count: *mut ::core::ffi::c_uint,
clocksMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the list of possible graphics clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param memoryClockMHz Memory clock for which to return possible graphics clocks
@param count Reference in which to provide the \a clocksMHz array size, and
to return the number of elements
@param clocksMHz Reference in which to return the clocks in MHz
@return
- \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_FOUND if the specified \a memoryClockMHz is not a supported frequency
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetApplicationsClocks
@see nvmlDeviceGetSupportedMemoryClocks*/
fn nvmlDeviceGetSupportedGraphicsClocks(
device: cuda_types::nvml::nvmlDevice_t,
memoryClockMHz: ::core::ffi::c_uint,
count: *mut ::core::ffi::c_uint,
clocksMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the current state of Auto Boosted clocks on a device and store it in \a isEnabled
For Kepler &tm; or newer fully supported devices.
Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
to maximize performance as thermal limits allow.
On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks.
Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
behavior.
@param device The identifier of the target device
@param isEnabled Where to store the current state of Auto Boosted clocks of the target device
@param defaultIsEnabled Where to store the default Auto Boosted clocks behavior of the target device that the device will
revert to when no applications are using the GPU
@return
- \ref NVML_SUCCESS If \a isEnabled has been been set with the Auto Boosted clocks state of \a device
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isEnabled is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceGetAutoBoostedClocksEnabled(
device: cuda_types::nvml::nvmlDevice_t,
isEnabled: *mut cuda_types::nvml::nvmlEnableState_t,
defaultIsEnabled: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the intended operating speed of the device's fan.
Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the
output will not match the actual fan speed.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed.
This value may exceed 100% in certain cases.
@param device The identifier of the target device
@param speed Reference in which to return the fan speed percentage
@return
- \ref NVML_SUCCESS if \a speed has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a speed is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetFanSpeed(
device: cuda_types::nvml::nvmlDevice_t,
speed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the intended operating speed of the device's specified fan.
Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the
output will not match the actual fan speed.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed.
This value may exceed 100% in certain cases.
@param device The identifier of the target device
@param fan The index of the target fan, zero indexed.
@param speed Reference in which to return the fan speed percentage
@return
- \ref NVML_SUCCESS if \a speed has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer than Maxwell
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetFanSpeed_v2(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
speed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the intended target speed of the device's specified fan.
Normally, the driver dynamically adjusts the fan based on
the needs of the GPU. But when user set fan speed using nvmlDeviceSetFanSpeed_v2,
the driver will attempt to make the fan achieve the setting in
nvmlDeviceSetFanSpeed_v2. The actual current speed of the fan
is reported in nvmlDeviceGetFanSpeed_v2.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed.
This value may exceed 100% in certain cases.
@param device The identifier of the target device
@param fan The index of the target fan, zero indexed.
@param targetSpeed Reference in which to return the fan speed percentage
@return
- \ref NVML_SUCCESS if \a speed has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer than Maxwell
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetTargetFanSpeed(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
targetSpeed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the min and max fan speed that user can set for the GPU fan.
For all cuda-capable discrete products with fans
@param device The identifier of the target device
@param minSpeed The minimum speed allowed to set
@param maxSpeed The maximum speed allowed to set
return
NVML_SUCCESS if speed has been adjusted
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if device is invalid
NVML_ERROR_NOT_SUPPORTED if the device does not support this
(doesn't have fans)
NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMinMaxFanSpeed(
device: cuda_types::nvml::nvmlDevice_t,
minSpeed: *mut ::core::ffi::c_uint,
maxSpeed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets current fan control policy.
For Maxwell &tm; or newer fully supported devices.
For all cuda-capable discrete products with fans
device The identifier of the target \a device
policy Reference in which to return the fan control \a policy
return
NVML_SUCCESS if \a policy has been populated
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a policy is null or the \a fan given doesn't reference
a fan that exists.
NVML_ERROR_NOT_SUPPORTED if the \a device is older than Maxwell
NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetFanControlPolicy_v2(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
policy: *mut cuda_types::nvml::nvmlFanControlPolicy_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the number of fans on the device.
For all discrete products with dedicated fans.
@param device The identifier of the target device
@param numFans The number of fans
@return
- \ref NVML_SUCCESS if \a fan number query was successful
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a numFans is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNumFans(
device: cuda_types::nvml::nvmlDevice_t,
numFans: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current temperature readings for the device, in degrees C.
For all products.
See \ref nvmlTemperatureSensors_t for details on available temperature sensors.
@param device The identifier of the target device
@param sensorType Flag that indicates which sensor reading to retrieve
@param temp Reference in which to return the temperature reading
@return
- \ref NVML_SUCCESS if \a temp has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a sensorType is invalid or \a temp is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have the specified sensor
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetTemperature(
device: cuda_types::nvml::nvmlDevice_t,
sensorType: cuda_types::nvml::nvmlTemperatureSensors_t,
temp: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C.
For Kepler &tm; or newer fully supported devices.
See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds.
Note: This API is no longer the preferred interface for retrieving the following temperature thresholds
on Ada and later architectures: NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN,
NVML_TEMPERATURE_THRESHOLD_MEM_MAX and NVML_TEMPERATURE_THRESHOLD_GPU_MAX.
Support for reading these temperature thresholds for Ada and later architectures would be removed from this
API in future releases. Please use \ref nvmlDeviceGetFieldValues with NVML_FI_DEV_TEMPERATURE_* fields to retrieve
temperature thresholds on these architectures.
@param device The identifier of the target device
@param thresholdType The type of threshold value queried
@param temp Reference in which to return the temperature reading
@return
- \ref NVML_SUCCESS if \a temp has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a thresholdType is invalid or \a temp is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature sensor or is unsupported
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetTemperatureThreshold(
device: cuda_types::nvml::nvmlDevice_t,
thresholdType: cuda_types::nvml::nvmlTemperatureThresholds_t,
temp: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Used to execute a list of thermal system instructions.
@param device The identifier of the target device
@param sensorIndex The index of the thermal sensor
@param pThermalSettings Reference in which to return the thermal sensor information
@return
- \ref NVML_SUCCESS if \a pThermalSettings has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pThermalSettings is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetThermalSettings(
device: cuda_types::nvml::nvmlDevice_t,
sensorIndex: ::core::ffi::c_uint,
pThermalSettings: *mut cuda_types::nvml::nvmlGpuThermalSettings_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current performance state for the device.
For Fermi &tm; or newer fully supported devices.
See \ref nvmlPstates_t for details on allowed performance states.
@param device The identifier of the target device
@param pState Reference in which to return the performance state reading
@return
- \ref NVML_SUCCESS if \a pState has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPerformanceState(
device: cuda_types::nvml::nvmlDevice_t,
pState: *mut cuda_types::nvml::nvmlPstates_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves current clocks event reasons.
For all fully supported products.
\note More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once.
@param device The identifier of the target device
@param clocksEventReasons Reference in which to return bitmask of active clocks event
reasons
@return
- \ref NVML_SUCCESS if \a clocksEventReasons has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clocksEventReasons is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlClocksEventReasons
@see nvmlDeviceGetSupportedClocksEventReasons*/
fn nvmlDeviceGetCurrentClocksEventReasons(
device: cuda_types::nvml::nvmlDevice_t,
clocksEventReasons: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/// @deprecated Use \ref nvmlDeviceGetCurrentClocksEventReasons instead
fn nvmlDeviceGetCurrentClocksThrottleReasons(
device: cuda_types::nvml::nvmlDevice_t,
clocksThrottleReasons: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves bitmask of supported clocks event reasons that can be returned by
\ref nvmlDeviceGetCurrentClocksEventReasons
For all fully supported products.
This method is not supported in virtual machines running virtual GPU (vGPU).
@param device The identifier of the target device
@param supportedClocksEventReasons Reference in which to return bitmask of supported
clocks event reasons
@return
- \ref NVML_SUCCESS if \a supportedClocksEventReasons has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a supportedClocksEventReasons is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlClocksEventReasons
@see nvmlDeviceGetCurrentClocksEventReasons*/
fn nvmlDeviceGetSupportedClocksEventReasons(
device: cuda_types::nvml::nvmlDevice_t,
supportedClocksEventReasons: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/// @deprecated Use \ref nvmlDeviceGetSupportedClocksEventReasons instead
fn nvmlDeviceGetSupportedClocksThrottleReasons(
device: cuda_types::nvml::nvmlDevice_t,
supportedClocksThrottleReasons: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization.
Retrieve the current performance state for the device.
For Fermi &tm; or newer fully supported devices.
See \ref nvmlPstates_t for details on allowed performance states.
@param device The identifier of the target device
@param pState Reference in which to return the performance state reading
@return
- \ref NVML_SUCCESS if \a pState has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPowerState(
device: cuda_types::nvml::nvmlDevice_t,
pState: *mut cuda_types::nvml::nvmlPstates_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve performance monitor samples from the associated subdevice.
@param device
@param pDynamicPstatesInfo
@return
- \ref NVML_SUCCESS if \a pDynamicPstatesInfo has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pDynamicPstatesInfo is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetDynamicPstatesInfo(
device: cuda_types::nvml::nvmlDevice_t,
pDynamicPstatesInfo: *mut cuda_types::nvml::nvmlGpuDynamicPstatesInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the MemClk (Memory Clock) VF offset value.
@param[in] device The identifier of the target device
@param[out] offset The retrieved MemClk VF offset value
@return
- \ref NVML_SUCCESS if \a offset has been successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMemClkVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
offset: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve min and max clocks of some clock domain for a given PState
@param device The identifier of the target device
@param type Clock domain
@param pstate PState to query
@param minClockMHz Reference in which to return min clock frequency
@param maxClockMHz Reference in which to return max clock frequency
@return
- \ref NVML_SUCCESS if everything worked
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a type or \a pstate are invalid or both
\a minClockMHz and \a maxClockMHz are NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature*/
fn nvmlDeviceGetMinMaxClockOfPState(
device: cuda_types::nvml::nvmlDevice_t,
type_: cuda_types::nvml::nvmlClockType_t,
pstate: cuda_types::nvml::nvmlPstates_t,
minClockMHz: *mut ::core::ffi::c_uint,
maxClockMHz: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get all supported Performance States (P-States) for the device.
The returned array would contain a contiguous list of valid P-States supported by
the device. If the number of supported P-States is fewer than the size of the array
supplied missing elements would contain \a NVML_PSTATE_UNKNOWN.
The number of elements in the returned list will never exceed \a NVML_MAX_GPU_PERF_PSTATES.
@param device The identifier of the target device
@param pstates Container to return the list of performance states
supported by device
@param size Size of the supplied \a pstates array in bytes
@return
- \ref NVML_SUCCESS if \a pstates array has been retrieved
- \ref NVML_ERROR_INSUFFICIENT_SIZE if the the container supplied was not large enough to
hold the resulting list
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a pstates is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support performance state readings
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetSupportedPerformanceStates(
device: cuda_types::nvml::nvmlDevice_t,
pstates: *mut cuda_types::nvml::nvmlPstates_t,
size: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the GPCCLK min max VF offset value.
@param[in] device The identifier of the target device
@param[out] minOffset The retrieved GPCCLK VF min offset value
@param[out] maxOffset The retrieved GPCCLK VF max offset value
@return
- \ref NVML_SUCCESS if \a offset has been successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGpcClkMinMaxVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
minOffset: *mut ::core::ffi::c_int,
maxOffset: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the MemClk (Memory Clock) min max VF offset value.
@param[in] device The identifier of the target device
@param[out] minOffset The retrieved MemClk VF min offset value
@param[out] maxOffset The retrieved MemClk VF max offset value
@return
- \ref NVML_SUCCESS if \a offset has been successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMemClkMinMaxVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
minOffset: *mut ::core::ffi::c_int,
maxOffset: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** This API has been deprecated.
Retrieves the power management mode associated with this device.
For products from the Fermi family.
- Requires \a NVML_INFOROM_POWER version 3.0 or higher.
For from the Kepler or newer families.
- Does not require \a NVML_INFOROM_POWER object.
This flag indicates whether any power management algorithm is currently active on the device. An
enabled state does not necessarily mean the device is being actively throttled -- only that
that the driver will do so if the appropriate conditions are met.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param mode Reference in which to return the current power management mode
@return
- \ref NVML_SUCCESS if \a mode has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPowerManagementMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the power management limit associated with this device.
For Fermi &tm; or newer fully supported devices.
The power limit defines the upper boundary for the card's power draw. If
the card's total power draw reaches this limit the power management algorithm kicks in.
This reading is only available if power management mode is supported.
See \ref nvmlDeviceGetPowerManagementMode.
@param device The identifier of the target device
@param limit Reference in which to return the power management limit in milliwatts
@return
- \ref NVML_SUCCESS if \a limit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPowerManagementLimit(
device: cuda_types::nvml::nvmlDevice_t,
limit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves information about possible values of power management limits on this device.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param minLimit Reference in which to return the minimum power management limit in milliwatts
@param maxLimit Reference in which to return the maximum power management limit in milliwatts
@return
- \ref NVML_SUCCESS if \a minLimit and \a maxLimit have been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minLimit or \a maxLimit is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetPowerManagementLimit*/
fn nvmlDeviceGetPowerManagementLimitConstraints(
device: cuda_types::nvml::nvmlDevice_t,
minLimit: *mut ::core::ffi::c_uint,
maxLimit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves default power management limit on this device, in milliwatts.
Default power management limit is a power management limit that the device boots with.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param defaultLimit Reference in which to return the default power management limit in milliwatts
@return
- \ref NVML_SUCCESS if \a defaultLimit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPowerManagementDefaultLimit(
device: cuda_types::nvml::nvmlDevice_t,
defaultLimit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory)
For Fermi &tm; or newer fully supported devices.
On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw. On Ampere
(except GA100) or newer GPUs, the API returns power averaged over 1 sec interval. On GA100 and
older architectures, instantaneous power is returned.
See \ref NVML_FI_DEV_POWER_AVERAGE and \ref NVML_FI_DEV_POWER_INSTANT to query specific power
values.
It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode.
@param device The identifier of the target device
@param power Reference in which to return the power usage information
@return
- \ref NVML_SUCCESS if \a power has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a power is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support power readings
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPowerUsage(
device: cuda_types::nvml::nvmlDevice_t,
power: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was last reloaded
For Volta &tm; or newer fully supported devices.
@param device The identifier of the target device
@param energy Reference in which to return the energy consumption information
@return
- \ref NVML_SUCCESS if \a energy has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a energy is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support energy readings
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetTotalEnergyConsumption(
device: cuda_types::nvml::nvmlDevice_t,
energy: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the effective power limit that the driver enforces after taking into account all limiters
Note: This can be different from the \ref nvmlDeviceGetPowerManagementLimit if other limits are set elsewhere
This includes the out of band power limit interface
For Kepler &tm; or newer fully supported devices.
@param device The device to communicate with
@param limit Reference in which to return the power management limit in milliwatts
@return
- \ref NVML_SUCCESS if \a limit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetEnforcedPowerLimit(
device: cuda_types::nvml::nvmlDevice_t,
limit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot).
For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
Not supported on Quadro ® and Tesla &tm; C-class products.
@param device The identifier of the target device
@param current Reference in which to return the current GOM
@param pending Reference in which to return the pending GOM
@return
- \ref NVML_SUCCESS if \a mode has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a current or \a pending is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlGpuOperationMode_t
@see nvmlDeviceSetGpuOperationMode*/
fn nvmlDeviceGetGpuOperationMode(
device: cuda_types::nvml::nvmlDevice_t,
current: *mut cuda_types::nvml::nvmlGpuOperationMode_t,
pending: *mut cuda_types::nvml::nvmlGpuOperationMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the amount of used, free, reserved and total memory available on the device, in bytes.
The reserved amount is supported on version 2 only.
For all products.
Enabling ECC reduces the amount of total available memory, due to the extra required parity bits.
Under WDDM most device memory is allocated and managed on startup by Windows.
Under Linux and Windows TCC, the reported amount of used memory is equal to the sum of memory allocated
by all active channels on the device.
See \ref nvmlMemory_v2_t for details on available memory info.
@note In MIG mode, if device handle is provided, the API returns aggregate
information, only if the caller has appropriate privileges. Per-instance
information can be queried by using specific MIG device handles.
@note nvmlDeviceGetMemoryInfo_v2 adds additional memory information.
@note On systems where GPUs are NUMA nodes, the accuracy of FB memory utilization
provided by this API depends on the memory accounting of the operating system.
This is because FB memory is managed by the operating system instead of the NVIDIA GPU driver.
Typically, pages allocated from FB memory are not released even after
the process terminates to enhance performance. In scenarios where
the operating system is under memory pressure, it may resort to utilizing FB memory.
Such actions can result in discrepancies in the accuracy of memory reporting.
@param device The identifier of the target device
@param memory Reference in which to return the memory information
@return
- \ref NVML_SUCCESS if \a memory has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMemoryInfo(
device: cuda_types::nvml::nvmlDevice_t,
memory: *mut cuda_types::nvml::nvmlMemory_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
fn nvmlDeviceGetMemoryInfo_v2(
device: cuda_types::nvml::nvmlDevice_t,
memory: *mut cuda_types::nvml::nvmlMemory_v2_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current compute mode for the device.
For all products.
See \ref nvmlComputeMode_t for details on allowed compute modes.
@param device The identifier of the target device
@param mode Reference in which to return the current compute mode
@return
- \ref NVML_SUCCESS if \a mode has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetComputeMode()*/
fn nvmlDeviceGetComputeMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: *mut cuda_types::nvml::nvmlComputeMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the CUDA compute capability of the device.
For all products.
Returns the major and minor compute capability version numbers of the
device. The major and minor versions are equivalent to the
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR and
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR attributes that would be
returned by CUDA's cuDeviceGetAttribute().
@param device The identifier of the target device
@param major Reference in which to return the major CUDA compute capability
@param minor Reference in which to return the minor CUDA compute capability
@return
- \ref NVML_SUCCESS if \a major and \a minor have been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a major or \a minor are NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCudaComputeCapability(
device: cuda_types::nvml::nvmlDevice_t,
major: *mut ::core::ffi::c_int,
minor: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current and pending ECC modes for the device.
For Fermi &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 1.0 or higher.
Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following
the next reboot.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param current Reference in which to return the current ECC mode
@param pending Reference in which to return the pending ECC mode
@return
- \ref NVML_SUCCESS if \a current and \a pending have been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or either \a current or \a pending is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetEccMode()*/
fn nvmlDeviceGetEccMode(
device: cuda_types::nvml::nvmlDevice_t,
current: *mut cuda_types::nvml::nvmlEnableState_t,
pending: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the default ECC modes for the device.
For Fermi &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 1.0 or higher.
See \ref nvmlEnableState_t for details on allowed modes.
@param device The identifier of the target device
@param defaultMode Reference in which to return the default ECC mode
@return
- \ref NVML_SUCCESS if \a current and \a pending have been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a default is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetEccMode()*/
fn nvmlDeviceGetDefaultEccMode(
device: cuda_types::nvml::nvmlDevice_t,
defaultMode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the device boardId from 0-N.
Devices with the same boardId indicate GPUs connected to the same PLX. Use in conjunction with
\ref nvmlDeviceGetMultiGpuBoard() to decide if they are on the same board as well.
The boardId returned is a unique ID for the current configuration. Uniqueness and ordering across
reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and
the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will
always return those values but they will always be different from each other).
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param boardId Reference in which to return the device's board ID
@return
- \ref NVML_SUCCESS if \a boardId has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a boardId is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetBoardId(
device: cuda_types::nvml::nvmlDevice_t,
boardId: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves whether the device is on a Multi-GPU Board
Devices that are on multi-GPU boards will set \a multiGpuBool to a non-zero value.
For Fermi &tm; or newer fully supported devices.
@param device The identifier of the target device
@param multiGpuBool Reference in which to return a zero or non-zero value
to indicate whether the device is on a multi GPU board
@return
- \ref NVML_SUCCESS if \a multiGpuBool has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a multiGpuBool is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMultiGpuBoard(
device: cuda_types::nvml::nvmlDevice_t,
multiGpuBool: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the total ECC error counts for the device.
For Fermi &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 1.0 or higher.
Requires ECC Mode to be enabled.
The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of
errors across the entire device.
See \ref nvmlMemoryErrorType_t for a description of available error types.\n
See \ref nvmlEccCounterType_t for a description of available counter types.
@param device The identifier of the target device
@param errorType Flag that specifies the type of the errors.
@param counterType Flag that specifies the counter-type of the errors.
@param eccCounts Reference in which to return the specified ECC errors
@return
- \ref NVML_SUCCESS if \a eccCounts has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceClearEccErrorCounts()*/
fn nvmlDeviceGetTotalEccErrors(
device: cuda_types::nvml::nvmlDevice_t,
errorType: cuda_types::nvml::nvmlMemoryErrorType_t,
counterType: cuda_types::nvml::nvmlEccCounterType_t,
eccCounts: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the detailed ECC error counts for the device.
@deprecated This API supports only a fixed set of ECC error locations
On different GPU architectures different locations are supported
See \ref nvmlDeviceGetMemoryErrorCounter
For Fermi &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts.
Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts.
Requires ECC Mode to be enabled.
Detailed errors provide separate ECC counts for specific parts of the memory system.
Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported.
See \ref nvmlMemoryErrorType_t for a description of available bit types.\n
See \ref nvmlEccCounterType_t for a description of available counter types.\n
See \ref nvmlEccErrorCounts_t for a description of provided detailed ECC counts.
@param device The identifier of the target device
@param errorType Flag that specifies the type of the errors.
@param counterType Flag that specifies the counter-type of the errors.
@param eccCounts Reference in which to return the specified ECC errors
@return
- \ref NVML_SUCCESS if \a eccCounts has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceClearEccErrorCounts()*/
fn nvmlDeviceGetDetailedEccErrors(
device: cuda_types::nvml::nvmlDevice_t,
errorType: cuda_types::nvml::nvmlMemoryErrorType_t,
counterType: cuda_types::nvml::nvmlEccCounterType_t,
eccCounts: *mut cuda_types::nvml::nvmlEccErrorCounts_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the requested memory error counter for the device.
For Fermi &tm; or newer fully supported devices.
Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts.
Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts.
Only applicable to devices with ECC.
Requires ECC Mode to be enabled.
@note On MIG-enabled GPUs, per instance information can be queried using specific
MIG device handles. Per instance information is currently only supported for
non-DRAM uncorrectable volatile errors. Querying volatile errors using device
handles is currently not supported.
See \ref nvmlMemoryErrorType_t for a description of available memory error types.\n
See \ref nvmlEccCounterType_t for a description of available counter types.\n
See \ref nvmlMemoryLocation_t for a description of available counter locations.\n
@param device The identifier of the target device
@param errorType Flag that specifies the type of error.
@param counterType Flag that specifies the counter-type of the errors.
@param locationType Specifies the location of the counter.
@param count Reference in which to return the ECC counter
@return
- \ref NVML_SUCCESS if \a count has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a bitTyp,e \a counterType or \a locationType is
invalid, or \a count is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support ECC error reporting in the specified memory
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMemoryErrorCounter(
device: cuda_types::nvml::nvmlDevice_t,
errorType: cuda_types::nvml::nvmlMemoryErrorType_t,
counterType: cuda_types::nvml::nvmlEccCounterType_t,
locationType: cuda_types::nvml::nvmlMemoryLocation_t,
count: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization rates for the device's major subsystems.
For Fermi &tm; or newer fully supported devices.
See \ref nvmlUtilization_t for details on available utilization rates.
\note During driver initialization when ECC is enabled one can see high GPU and Memory Utilization readings.
This is caused by ECC Memory Scrubbing mechanism that is performed during driver initialization.
@note On MIG-enabled GPUs, querying device utilization rates is not currently supported.
@param device The identifier of the target device
@param utilization Reference in which to return the utilization information
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a utilization is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetUtilizationRates(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut cuda_types::nvml::nvmlUtilization_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization and sampling size in microseconds for the Encoder
For Kepler &tm; or newer fully supported devices.
@note On MIG-enabled GPUs, querying encoder utilization is not currently supported.
@param device The identifier of the target device
@param utilization Reference to an unsigned int for encoder utilization info
@param samplingPeriodUs Reference to an unsigned int for the sampling period in US
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetEncoderUtilization(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut ::core::ffi::c_uint,
samplingPeriodUs: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current capacity of the device's encoder, as a percentage of maximum encoder capacity with valid values in the range 0-100.
For Maxwell &tm; or newer fully supported devices.
@param device The identifier of the target device
@param encoderQueryType Type of encoder to query
@param encoderCapacity Reference to an unsigned int for the encoder capacity
@return
- \ref NVML_SUCCESS if \a encoderCapacity is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a encoderCapacity is NULL, or \a device or \a encoderQueryType
are invalid
- \ref NVML_ERROR_NOT_SUPPORTED if device does not support the encoder specified in \a encodeQueryType
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetEncoderCapacity(
device: cuda_types::nvml::nvmlDevice_t,
encoderQueryType: cuda_types::nvml::nvmlEncoderType_t,
encoderCapacity: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current encoder statistics for a given device.
For Maxwell &tm; or newer fully supported devices.
@param device The identifier of the target device
@param sessionCount Reference to an unsigned int for count of active encoder sessions
@param averageFps Reference to an unsigned int for trailing average FPS of all active sessions
@param averageLatency Reference to an unsigned int for encode latency in microseconds
@return
- \ref NVML_SUCCESS if \a sessionCount, \a averageFps and \a averageLatency is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount, or \a device or \a averageFps,
or \a averageLatency is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetEncoderStats(
device: cuda_types::nvml::nvmlDevice_t,
sessionCount: *mut ::core::ffi::c_uint,
averageFps: *mut ::core::ffi::c_uint,
averageLatency: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves information about active encoder sessions on a target device.
An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfos. The
array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
written to the buffer.
If the supplied buffer is not large enough to accommodate the active session array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount.
To query the number of active encoder sessions, call this function with *sessionCount = 0. The code will return
NVML_SUCCESS with number of active encoder sessions updated in *sessionCount.
For Maxwell &tm; or newer fully supported devices.
@param device The identifier of the target device
@param sessionCount Reference to caller supplied array size, and returns the number of sessions.
@param sessionInfos Reference in which to return the session information
@return
- \ref NVML_SUCCESS if \a sessionInfos is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount
- \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL.
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetEncoderSessions(
device: cuda_types::nvml::nvmlDevice_t,
sessionCount: *mut ::core::ffi::c_uint,
sessionInfos: *mut cuda_types::nvml::nvmlEncoderSessionInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization and sampling size in microseconds for the Decoder
For Kepler &tm; or newer fully supported devices.
@note On MIG-enabled GPUs, querying decoder utilization is not currently supported.
@param device The identifier of the target device
@param utilization Reference to an unsigned int for decoder utilization info
@param samplingPeriodUs Reference to an unsigned int for the sampling period in US
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetDecoderUtilization(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut ::core::ffi::c_uint,
samplingPeriodUs: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization and sampling size in microseconds for the JPG
%TURING_OR_NEWER%
@note On MIG-enabled GPUs, querying decoder utilization is not currently supported.
@param device The identifier of the target device
@param utilization Reference to an unsigned int for jpg utilization info
@param samplingPeriodUs Reference to an unsigned int for the sampling period in US
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetJpgUtilization(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut ::core::ffi::c_uint,
samplingPeriodUs: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization and sampling size in microseconds for the OFA (Optical Flow Accelerator)
%TURING_OR_NEWER%
@note On MIG-enabled GPUs, querying decoder utilization is not currently supported.
@param device The identifier of the target device
@param utilization Reference to an unsigned int for ofa utilization info
@param samplingPeriodUs Reference to an unsigned int for the sampling period in US
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetOfaUtilization(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut ::core::ffi::c_uint,
samplingPeriodUs: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the active frame buffer capture sessions statistics for a given device.
For Maxwell &tm; or newer fully supported devices.
@param device The identifier of the target device
@param fbcStats Reference to nvmlFBCStats_t structure containing NvFBC stats
@return
- \ref NVML_SUCCESS if \a fbcStats is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a fbcStats is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetFBCStats(
device: cuda_types::nvml::nvmlDevice_t,
fbcStats: *mut cuda_types::nvml::nvmlFBCStats_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves information about active frame buffer capture sessions on a target device.
An array of active FBC sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The
array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
written to the buffer.
If the supplied buffer is not large enough to accommodate the active session array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount.
To query the number of active FBC sessions, call this function with *sessionCount = 0. The code will return
NVML_SUCCESS with number of active FBC sessions updated in *sessionCount.
For Maxwell &tm; or newer fully supported devices.
@note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may
be zero if there are no new frames captured since the session started.
@param device The identifier of the target device
@param sessionCount Reference to caller supplied array size, and returns the number of sessions.
@param sessionInfo Reference in which to return the session information
@return
- \ref NVML_SUCCESS if \a sessionInfo is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount
- \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL.
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetFBCSessions(
device: cuda_types::nvml::nvmlDevice_t,
sessionCount: *mut ::core::ffi::c_uint,
sessionInfo: *mut cuda_types::nvml::nvmlFBCSessionInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current and pending driver model for the device.
For Fermi &tm; or newer fully supported devices.
For windows only.
On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
to the device it must run in WDDM mode. TCC mode is preferred if a display is not attached.
See \ref nvmlDriverModel_t for details on available driver models.
@param device The identifier of the target device
@param current Reference in which to return the current driver model
@param pending Reference in which to return the pending driver model
@return
- \ref NVML_SUCCESS if either \a current and/or \a pending have been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or both \a current and \a pending are NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceSetDriverModel()*/
fn nvmlDeviceGetDriverModel(
device: cuda_types::nvml::nvmlDevice_t,
current: *mut cuda_types::nvml::nvmlDriverModel_t,
pending: *mut cuda_types::nvml::nvmlDriverModel_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get VBIOS version of the device.
For all products.
The VBIOS version may change from time to time. It will not exceed 32 characters in length
(including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE.
@param device The identifier of the target device
@param version Reference to which to return the VBIOS version
@param length The maximum allowed length of the string returned in \a version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a version is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVbiosVersion(
device: cuda_types::nvml::nvmlDevice_t,
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Bridge Chip Information for all the bridge chips on the board.
For all fully supported products.
Only applicable to multi-GPU products.
@param device The identifier of the target device
@param bridgeHierarchy Reference to the returned bridge chip Hierarchy
@return
- \ref NVML_SUCCESS if bridge chip exists
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a bridgeInfo is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if bridge chip not supported on the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceGetBridgeChipInfo(
device: cuda_types::nvml::nvmlDevice_t,
bridgeHierarchy: *mut cuda_types::nvml::nvmlBridgeChipHierarchy_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get information about processes with a compute context on a device
For Fermi &tm; or newer fully supported devices.
This function returns information only about compute running processes (e.g. CUDA application which have
active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function.
To query the current number of running compute processes, call this function with *infoCount = 0. The
return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
\a infos is allowed to be NULL.
The usedGpuMemory field returned is all of the memory used by the application.
Keep in mind that information returned by this call is dynamic and the number of elements might change in
time. Allocate more space for \a infos table in case new compute processes are spawned.
@note In MIG mode, if device handle is provided, the API returns aggregate information, only if
the caller has appropriate privileges. Per-instance information can be queried by using
specific MIG device handles.
Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode.
@param device The device handle or MIG device handle
@param infoCount Reference in which to provide the \a infos array size, and
to return the number of returned elements
@param infos Reference in which to return the process information
@return
- \ref NVML_SUCCESS if \a infoCount and \a infos have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
\a infoCount will contain minimal amount of space necessary for
the call to complete
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see \ref nvmlSystemGetProcessName*/
fn nvmlDeviceGetComputeRunningProcesses_v3(
device: cuda_types::nvml::nvmlDevice_t,
infoCount: *mut ::core::ffi::c_uint,
infos: *mut cuda_types::nvml::nvmlProcessInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get information about processes with a graphics context on a device
For Kepler &tm; or newer fully supported devices.
This function returns information only about graphics based processes
(eg. applications using OpenGL, DirectX)
To query the current number of running graphics processes, call this function with *infoCount = 0. The
return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
\a infos is allowed to be NULL.
The usedGpuMemory field returned is all of the memory used by the application.
Keep in mind that information returned by this call is dynamic and the number of elements might change in
time. Allocate more space for \a infos table in case new graphics processes are spawned.
@note In MIG mode, if device handle is provided, the API returns aggregate information, only if
the caller has appropriate privileges. Per-instance information can be queried by using
specific MIG device handles.
Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode.
@param device The device handle or MIG device handle
@param infoCount Reference in which to provide the \a infos array size, and
to return the number of returned elements
@param infos Reference in which to return the process information
@return
- \ref NVML_SUCCESS if \a infoCount and \a infos have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
\a infoCount will contain minimal amount of space necessary for
the call to complete
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see \ref nvmlSystemGetProcessName*/
fn nvmlDeviceGetGraphicsRunningProcesses_v3(
device: cuda_types::nvml::nvmlDevice_t,
infoCount: *mut ::core::ffi::c_uint,
infos: *mut cuda_types::nvml::nvmlProcessInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get information about processes with a MPS compute context on a device
For Volta &tm; or newer fully supported devices.
This function returns information only about compute running processes (e.g. CUDA application which have
active context) utilizing MPS. Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by
this function.
To query the current number of running compute processes, call this function with *infoCount = 0. The
return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call
\a infos is allowed to be NULL.
The usedGpuMemory field returned is all of the memory used by the application.
Keep in mind that information returned by this call is dynamic and the number of elements might change in
time. Allocate more space for \a infos table in case new compute processes are spawned.
@note In MIG mode, if device handle is provided, the API returns aggregate information, only if
the caller has appropriate privileges. Per-instance information can be queried by using
specific MIG device handles.
Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode.
@param device The device handle or MIG device handle
@param infoCount Reference in which to provide the \a infos array size, and
to return the number of returned elements
@param infos Reference in which to return the process information
@return
- \ref NVML_SUCCESS if \a infoCount and \a infos have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small
\a infoCount will contain minimal amount of space necessary for
the call to complete
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see \ref nvmlSystemGetProcessName*/
fn nvmlDeviceGetMPSComputeRunningProcesses_v3(
device: cuda_types::nvml::nvmlDevice_t,
infoCount: *mut ::core::ffi::c_uint,
infos: *mut cuda_types::nvml::nvmlProcessInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get information about running processes on a device for input context
%HOPPER_OR_NEWER%
This function returns information only about running processes (e.g. CUDA application which have
active context).
To determine the size of the @ref plist->procArray array to allocate, call the function with
@ref plist->numProcArrayEntries set to zero and @ref plist->procArray set to NULL. The return
code will be either NVML_ERROR_INSUFFICIENT_SIZE (if there are valid processes of type
@ref plist->mode to report on, in which case the @ref plist->numProcArrayEntries field will
indicate the required number of entries in the array) or NVML_SUCCESS (if no processes of type
@ref plist->mode exist).
The usedGpuMemory field returned is all of the memory used by the application.
The usedGpuCcProtectedMemory field returned is all of the protected memory used by the application.
Keep in mind that information returned by this call is dynamic and the number of elements might change in
time. Allocate more space for \a plist->procArray table in case new processes are spawned.
@note In MIG mode, if device handle is provided, the API returns aggregate information, only if
the caller has appropriate privileges. Per-instance information can be queried by using
specific MIG device handles.
Querying per-instance information using MIG device handles is not supported if the device is in
vGPU Host virtualization mode.
Protected memory usage is currently not available in MIG mode and in windows.
@param device The device handle or MIG device handle
@param plist Reference in which to process detail list
@param plist->version The api version
@param plist->mode The process mode
@param plist->procArray Reference in which to return the process information
@param plist->numProcArrayEntries Proc array size of returned entries
@return
- \ref NVML_SUCCESS if \a plist->numprocArrayEntries and \a plist->procArray have been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a plist->numprocArrayEntries indicates that the \a plist->procArray is too small
\a plist->numprocArrayEntries will contain minimal amount of space necessary for
the call to complete
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a plist is NULL, \a plist->version is invalid,
\a plist->mode is invalid,
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceGetRunningProcessDetailList(
device: cuda_types::nvml::nvmlDevice_t,
plist: *mut cuda_types::nvml::nvmlProcessDetailList_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Check if the GPU devices are on the same physical board.
For all fully supported products.
@param device1 The first GPU device
@param device2 The second GPU device
@param onSameBoard Reference in which to return the status.
Non-zero indicates that the GPUs are on the same board.
@return
- \ref NVML_SUCCESS if \a onSameBoard has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a dev1 or \a dev2 are invalid or \a onSameBoard is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this check is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the either GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceOnSameBoard(
device1: cuda_types::nvml::nvmlDevice_t,
device2: cuda_types::nvml::nvmlDevice_t,
onSameBoard: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs.
If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions.
For all fully supported products.
@param device The identifier of the target device
@param apiType Target API type for this operation
@param isRestricted Reference in which to return the current restriction
NVML_FEATURE_ENABLED indicates that the API is root-only
NVML_FEATURE_DISABLED indicates that the API is accessible to all users
@return
- \ref NVML_SUCCESS if \a isRestricted has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device or the device does not support
the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is
not supported by the device)
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlRestrictedAPI_t*/
fn nvmlDeviceGetAPIRestriction(
device: cuda_types::nvml::nvmlDevice_t,
apiType: cuda_types::nvml::nvmlRestrictedAPI_t,
isRestricted: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets recent samples for the GPU.
For Kepler &tm; or newer fully supported devices.
Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by
the driver.
Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t.
To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL.
The returned samplesCount will provide the number of samples that can be queried. The user needs to
allocate the buffer with size as samplesCount * sizeof(nvmlSample_t).
lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the
underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query
to get more recent samples.
This method fetches the number of entries which can be accommodated in the provided samples array, and the
reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this
method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost.
@note On MIG-enabled GPUs, querying the following sample types, NVML_GPU_UTILIZATION_SAMPLES, NVML_MEMORY_UTILIZATION_SAMPLES
NVML_ENC_UTILIZATION_SAMPLES and NVML_DEC_UTILIZATION_SAMPLES, is not currently supported.
@param device The identifier for the target device
@param type Type of sampling event
@param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp.
@param sampleValType Output parameter to represent the type of sample value as described in nvmlSampleVal_t
@param sampleCount Reference to provide the number of elements which can be queried in samples array
@param samples Reference in which samples are returned
@return
- \ref NVML_SUCCESS if samples are successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a samplesCount is NULL or
reference to \a sampleCount is 0 for non null \a samples
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetSamples(
device: cuda_types::nvml::nvmlDevice_t,
type_: cuda_types::nvml::nvmlSamplingType_t,
lastSeenTimeStamp: ::core::ffi::c_ulonglong,
sampleValType: *mut cuda_types::nvml::nvmlValueType_t,
sampleCount: *mut ::core::ffi::c_uint,
samples: *mut cuda_types::nvml::nvmlSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets Total, Available and Used size of BAR1 memory.
BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party
devices (peer-to-peer on the PCIE bus).
@note In MIG mode, if device handle is provided, the API returns aggregate
information, only if the caller has appropriate privileges. Per-instance
information can be queried by using specific MIG device handles.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param bar1Memory Reference in which BAR1 memory
information is returned.
@return
- \ref NVML_SUCCESS if BAR1 memory is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a bar1Memory is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceGetBAR1MemoryInfo(
device: cuda_types::nvml::nvmlDevice_t,
bar1Memory: *mut cuda_types::nvml::nvmlBAR1Memory_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the duration of time during which the device was throttled (lower than requested clocks) due to power
or thermal constraints.
The method is important to users who are tying to understand if their GPUs throttle at any point during their applications. The
difference in violation times at two different reference times gives the indication of GPU throttling event.
Violation for thermal capping is not supported at this time.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param perfPolicyType Represents Performance policy which can trigger GPU throttling
@param violTime Reference to which violation time related information is returned
@return
- \ref NVML_SUCCESS if violation time is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a perfPolicyType is invalid, or \a violTime is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetViolationStatus(
device: cuda_types::nvml::nvmlDevice_t,
perfPolicyType: cuda_types::nvml::nvmlPerfPolicyType_t,
violTime: *mut cuda_types::nvml::nvmlViolationTime_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's interrupt number
@param device The identifier of the target device
@param irqNum The interrupt number associated with the specified device
@return
- \ref NVML_SUCCESS if irq number is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a irqNum is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetIrqNum(
device: cuda_types::nvml::nvmlDevice_t,
irqNum: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's core count
@param device The identifier of the target device
@param numCores The number of cores for the specified device
@return
- \ref NVML_SUCCESS if Gpu core count is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a numCores is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetNumGpuCores(
device: cuda_types::nvml::nvmlDevice_t,
numCores: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the devices power source
@param device The identifier of the target device
@param powerSource The power source of the device
@return
- \ref NVML_SUCCESS if the current power source was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a powerSource is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetPowerSource(
device: cuda_types::nvml::nvmlDevice_t,
powerSource: *mut cuda_types::nvml::nvmlPowerSource_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's memory bus width
@param device The identifier of the target device
@param busWidth The devices's memory bus width
@return
- \ref NVML_SUCCESS if the memory bus width is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a busWidth is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetMemoryBusWidth(
device: cuda_types::nvml::nvmlDevice_t,
busWidth: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's PCIE Max Link speed in MBPS
@param device The identifier of the target device
@param maxSpeed The devices's PCIE Max Link speed in MBPS
@return
- \ref NVML_SUCCESS if Pcie Max Link Speed is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a maxSpeed is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetPcieLinkMaxSpeed(
device: cuda_types::nvml::nvmlDevice_t,
maxSpeed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's PCIe Link speed in Mbps
@param device The identifier of the target device
@param pcieSpeed The devices's PCIe Max Link speed in Mbps
@return
- \ref NVML_SUCCESS if \a pcieSpeed has been retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pcieSpeed is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support PCIe speed getting
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPcieSpeed(
device: cuda_types::nvml::nvmlDevice_t,
pcieSpeed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Gets the device's Adaptive Clock status
@param device The identifier of the target device
@param adaptiveClockStatus The current adaptive clocking status, either
@ref NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED
or @ref NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED
@return
- \ref NVML_SUCCESS if the current adaptive clocking status is successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a adaptiveClockStatus is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
*/
fn nvmlDeviceGetAdaptiveClockInfoStatus(
device: cuda_types::nvml::nvmlDevice_t,
adaptiveClockStatus: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the type of the GPU Bus (PCIe, PCI, ...)
@param device The identifier of the target device
@param type The PCI Bus type
return
- \ref NVML_SUCCESS if the bus \a type is successfully retreived
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \device is invalid or \type is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetBusType(
device: cuda_types::nvml::nvmlDevice_t,
type_: *mut cuda_types::nvml::nvmlBusType_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Will be deprecated in a future release. Use \ref nvmlDeviceGetGpuFabricInfoV instead
Get fabric information associated with the device.
%HOPPER_OR_NEWER%
On Hopper + NVSwitch systems, GPU is registered with the NVIDIA Fabric Manager
Upon successful registration, the GPU is added to the NVLink fabric to enable
peer-to-peer communication.
This API reports the current state of the GPU in the NVLink fabric
along with other useful information.
@param device The identifier of the target device
@param gpuFabricInfo Information about GPU fabric state
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support gpu fabric*/
fn nvmlDeviceGetGpuFabricInfo(
device: cuda_types::nvml::nvmlDevice_t,
gpuFabricInfo: *mut cuda_types::nvml::nvmlGpuFabricInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Versioned wrapper around \ref nvmlDeviceGetGpuFabricInfo that accepts a versioned
\ref nvmlGpuFabricInfo_v2_t or later output structure.
@note The caller must set the \ref nvmlGpuFabricInfoV_t.version field to the
appropriate version prior to calling this function. For example:
\code
nvmlGpuFabricInfoV_t fabricInfo =
{ .version = nvmlGpuFabricInfo_v2 };
nvmlReturn_t result = nvmlDeviceGetGpuFabricInfoV(device,&fabricInfo);
\endcode
%HOPPER_OR_NEWER%
@param device The identifier of the target device
@param gpuFabricInfo Information about GPU fabric state
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support gpu fabric*/
fn nvmlDeviceGetGpuFabricInfoV(
device: cuda_types::nvml::nvmlDevice_t,
gpuFabricInfo: *mut cuda_types::nvml::nvmlGpuFabricInfoV_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing System capabilities.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param capabilities System CC capabilities
@return
- \ref NVML_SUCCESS if \a capabilities were successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a capabilities is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlSystemGetConfComputeCapabilities(
capabilities: *mut cuda_types::nvml::nvmlConfComputeSystemCaps_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing System State.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param state System CC State
@return
- \ref NVML_SUCCESS if \a state were successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a state is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlSystemGetConfComputeState(
state: *mut cuda_types::nvml::nvmlConfComputeSystemState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing Protected and Unprotected Memory Sizes.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param device Device handle
@param memInfo Protected/Unprotected Memory sizes
@return
- \ref NVML_SUCCESS if \a memInfo were successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a memInfo or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlDeviceGetConfComputeMemSizeInfo(
device: cuda_types::nvml::nvmlDevice_t,
memInfo: *mut cuda_types::nvml::nvmlConfComputeMemSizeInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing GPUs ready state.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param isAcceptingWork Returns GPU current work accepting state,
NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or
NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE
return
- \ref NVML_SUCCESS if \a current GPUs ready state were successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a isAcceptingWork is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlSystemGetConfComputeGpusReadyState(
isAcceptingWork: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing protected memory usage.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param device The identifier of the target device
@param memory Reference in which to return the memory information
@return
- \ref NVML_SUCCESS if \a memory has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetConfComputeProtectedMemoryUsage(
device: cuda_types::nvml::nvmlDevice_t,
memory: *mut cuda_types::nvml::nvmlMemory_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing Gpu certificate details.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param device The identifier of the target device
@param gpuCert Reference in which to return the gpu certificate information
@return
- \ref NVML_SUCCESS if \a gpu certificate info has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetConfComputeGpuCertificate(
device: cuda_types::nvml::nvmlDevice_t,
gpuCert: *mut cuda_types::nvml::nvmlConfComputeGpuCertificate_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing Gpu attestation report.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param device The identifier of the target device
@param gpuAtstReport Reference in which to return the gpu attestation report
@return
- \ref NVML_SUCCESS if \a gpu attestation report has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetConfComputeGpuAttestationReport(
device: cuda_types::nvml::nvmlDevice_t,
gpuAtstReport: *mut cuda_types::nvml::nvmlConfComputeGpuAttestationReport_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing key rotation threshold detail.
%HOPPER_OR_NEWER%
Supported on Linux, Windows TCC.
@param pKeyRotationThrInfo Reference in which to return the key rotation threshold data
@return
- \ref NVML_SUCCESS if \a gpu key rotation threshold info has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlSystemGetConfComputeKeyRotationThresholdInfo(
pKeyRotationThrInfo: *mut cuda_types::nvml::nvmlConfComputeGetKeyRotationThresholdInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get Conf Computing System Settings.
%HOPPER_OR_NEWER%
Supported on Linux, Windows TCC.
@param settings System CC settings
@return
- \ref NVML_SUCCESS if the query is success
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counters is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is invalid/unsupported
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlSystemGetConfComputeSettings(
settings: *mut cuda_types::nvml::nvmlSystemConfComputeSettings_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve GSP firmware version.
The caller passes in buffer via \a version and corresponding GSP firmware numbered version
is returned with the same parameter in string format.
@param device Device handle
@param version The retrieved GSP firmware version
@return
- \ref NVML_SUCCESS if GSP firmware version is sucessfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or GSP \a version pointer is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if GSP firmware is not enabled for GPU
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGspFirmwareVersion(
device: cuda_types::nvml::nvmlDevice_t,
version: *mut ::core::ffi::c_char,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve GSP firmware mode.
The caller passes in integer pointers. GSP firmware enablement and default mode information is returned with
corresponding parameters. The return value in \a isEnabled and \a defaultMode should be treated as boolean.
@param device Device handle
@param isEnabled Pointer to specify if GSP firmware is enabled
@param defaultMode Pointer to specify if GSP firmware is supported by default on \a device
@return
- \ref NVML_SUCCESS if GSP firmware mode is sucessfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or any of \a isEnabled or \a defaultMode is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGspFirmwareMode(
device: cuda_types::nvml::nvmlDevice_t,
isEnabled: *mut ::core::ffi::c_uint,
defaultMode: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries the state of per process accounting mode.
For Kepler &tm; or newer fully supported devices.
See \ref nvmlDeviceGetAccountingStats for more details.
See \ref nvmlDeviceSetAccountingMode
@param device The identifier of the target device
@param mode Reference in which to return the current accounting mode
@return
- \ref NVML_SUCCESS if the mode has been successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode are NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetAccountingMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries process's accounting stats.
For Kepler &tm; or newer fully supported devices.
Accounting stats capture GPU utilization and other statistics across the lifetime of a process.
Accounting stats can be queried during life time of the process and after its termination.
The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and
updated to actual running time after its termination.
Accounting stats are kept in a circular buffer, newly created processes overwrite information about old
processes.
See \ref nvmlAccountingStats_t for description of each returned metric.
List of processes that can be queried can be retrieved from \ref nvmlDeviceGetAccountingPids.
@note Accounting Mode needs to be on. See \ref nvmlDeviceGetAccountingMode.
@note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be
queried since they don't contribute to GPU utilization.
@note In case of pid collision stats of only the latest process (that terminated last) will be reported
@warning On Kepler devices per process statistics are accurate only if there's one process running on a GPU.
@param device The identifier of the target device
@param pid Process Id of the target process to query stats for
@param stats Reference in which to return the process's accounting stats
@return
- \ref NVML_SUCCESS if stats have been successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a stats are NULL
- \ref NVML_ERROR_NOT_FOUND if process stats were not found
- \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature or accounting mode is disabled
or on vGPU host.
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetAccountingBufferSize*/
fn nvmlDeviceGetAccountingStats(
device: cuda_types::nvml::nvmlDevice_t,
pid: ::core::ffi::c_uint,
stats: *mut cuda_types::nvml::nvmlAccountingStats_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries list of processes that can be queried for accounting stats. The list of processes returned
can be in running or terminated state.
For Kepler &tm; or newer fully supported devices.
To just query the number of processes ready to be queried, call this function with *count = 0 and
pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
For more details see \ref nvmlDeviceGetAccountingStats.
@note In case of PID collision some processes might not be accessible before the circular buffer is full.
@param device The identifier of the target device
@param count Reference in which to provide the \a pids array size, and
to return the number of elements ready to be queried
@param pids Reference in which to return list of process ids
@return
- \ref NVML_SUCCESS if pids were successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature or accounting mode is disabled
or on vGPU host.
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to
expected value)
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetAccountingBufferSize*/
fn nvmlDeviceGetAccountingPids(
device: cuda_types::nvml::nvmlDevice_t,
count: *mut ::core::ffi::c_uint,
pids: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the number of processes that the circular buffer with accounting pids can hold.
For Kepler &tm; or newer fully supported devices.
This is the maximum number of processes that accounting information will be stored for before information
about oldest processes will get overwritten by information about new processes.
@param device The identifier of the target device
@param bufferSize Reference in which to provide the size (in number of elements)
of the circular buffer for accounting stats.
@return
- \ref NVML_SUCCESS if buffer size was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a bufferSize is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetAccountingStats
@see nvmlDeviceGetAccountingPids*/
fn nvmlDeviceGetAccountingBufferSize(
device: cuda_types::nvml::nvmlDevice_t,
bufferSize: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the list of retired pages by source, including pages that are pending retirement
The address information provided from this API is the hardware address of the page that was retired. Note
that this does not match the virtual address used in CUDA, but will match the address information in XID 63
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param cause Filter page addresses by cause of retirement
@param pageCount Reference in which to provide the \a addresses buffer size, and
to return the number of retired pages that match \a cause
Set to 0 to query the size without allocating an \a addresses buffer
@param addresses Buffer to write the page addresses into
@return
- \ref NVML_SUCCESS if \a pageCount was populated and \a addresses was filled
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
matching page addresses. \a pageCount is set to the needed size.
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or
\a addresses is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetRetiredPages(
device: cuda_types::nvml::nvmlDevice_t,
cause: cuda_types::nvml::nvmlPageRetirementCause_t,
pageCount: *mut ::core::ffi::c_uint,
addresses: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the list of retired pages by source, including pages that are pending retirement
The address information provided from this API is the hardware address of the page that was retired. Note
that this does not match the virtual address used in CUDA, but will match the address information in XID 63
\note nvmlDeviceGetRetiredPages_v2 adds an additional timestamps parameter to return the time of each page's
retirement.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param cause Filter page addresses by cause of retirement
@param pageCount Reference in which to provide the \a addresses buffer size, and
to return the number of retired pages that match \a cause
Set to 0 to query the size without allocating an \a addresses buffer
@param addresses Buffer to write the page addresses into
@param timestamps Buffer to write the timestamps of page retirement, additional for _v2
@return
- \ref NVML_SUCCESS if \a pageCount was populated and \a addresses was filled
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the
matching page addresses. \a pageCount is set to the needed size.
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or
\a addresses is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetRetiredPages_v2(
device: cuda_types::nvml::nvmlDevice_t,
cause: cuda_types::nvml::nvmlPageRetirementCause_t,
pageCount: *mut ::core::ffi::c_uint,
addresses: *mut ::core::ffi::c_ulonglong,
timestamps: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Check if any pages are pending retirement and need a reboot to fully retire.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param isPending Reference in which to return the pending status
@return
- \ref NVML_SUCCESS if \a isPending was populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isPending is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetRetiredPagesPendingStatus(
device: cuda_types::nvml::nvmlDevice_t,
isPending: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get number of remapped rows. The number of rows reported will be based on
the cause of the remapping. isPending indicates whether or not there are
pending remappings. A reset will be required to actually remap the row.
failureOccurred will be set if a row remapping ever failed in the past. A
pending remapping won't affect future work on the GPU since
error-containment and dynamic page blacklisting will take care of that.
@note On MIG-enabled GPUs with active instances, querying the number of
remapped rows is not supported
For Ampere &tm; or newer fully supported devices.
@param device The identifier of the target device
@param corrRows Reference for number of rows remapped due to correctable errors
@param uncRows Reference for number of rows remapped due to uncorrectable errors
@param isPending Reference for whether or not remappings are pending
@param failureOccurred Reference that is set when a remapping has failed in the past
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_INVALID_ARGUMENT If \a corrRows, \a uncRows, \a isPending or \a failureOccurred is invalid
- \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN Unexpected error*/
fn nvmlDeviceGetRemappedRows(
device: cuda_types::nvml::nvmlDevice_t,
corrRows: *mut ::core::ffi::c_uint,
uncRows: *mut ::core::ffi::c_uint,
isPending: *mut ::core::ffi::c_uint,
failureOccurred: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the row remapper histogram. Returns the remap availability for each bank
on the GPU.
@param device Device handle
@param values Histogram values
@return
- \ref NVML_SUCCESS On success
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceGetRowRemapperHistogram(
device: cuda_types::nvml::nvmlDevice_t,
values: *mut cuda_types::nvml::nvmlRowRemapperHistogramValues_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get architecture for device
@param device The identifier of the target device
@param arch Reference where architecture is returned, if call successful.
Set to NVML_DEVICE_ARCH_* upon success
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a arch (output refererence) are invalid*/
fn nvmlDeviceGetArchitecture(
device: cuda_types::nvml::nvmlDevice_t,
arch: *mut cuda_types::nvml::nvmlDeviceArchitecture_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the frequency monitor fault status for the device.
For Ampere &tm; or newer fully supported devices.
Requires root user.
See \ref nvmlClkMonStatus_t for details on decoding the status output.
@param device The identifier of the target device
@param status Reference in which to return the clkmon fault status
@return
- \ref NVML_SUCCESS if \a status has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a status is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetClkMonStatus()*/
fn nvmlDeviceGetClkMonStatus(
device: cuda_types::nvml::nvmlDevice_t,
status: *mut cuda_types::nvml::nvmlClkMonStatus_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current utilization and process ID
For Maxwell &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running.
Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at
by \a utilization. One utilization sample structure is returned per process running, that had some non-zero utilization
during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values
are returned as "unsigned int" values. If no valid sample entries are found since the lastSeenTimeStamp, NVML_ERROR_NOT_FOUND
is returned.
To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
\a utilization set to NULL. The caller should allocate a buffer of size
processSamplesCount * sizeof(nvmlProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed
in \a utilization, and \a processSamplesCount set to the number of entries the buffer is sized for.
On successful return, the function updates \a processSamplesCount with the number of process utilization sample
structures that were actually written. This may differ from a previously read value as instances are created or
destroyed.
lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
@note On MIG-enabled GPUs, querying process utilization is not currently supported.
@param device The identifier of the target device
@param utilization Pointer to caller-supplied buffer in which guest process utilization samples are returned
@param processSamplesCount Pointer to caller-supplied array size, and returns number of processes running
@param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp.
@return
- \ref NVML_SUCCESS if \a utilization has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetProcessUtilization(
device: cuda_types::nvml::nvmlDevice_t,
utilization: *mut cuda_types::nvml::nvmlProcessUtilizationSample_t,
processSamplesCount: *mut ::core::ffi::c_uint,
lastSeenTimeStamp: ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the recent utilization and process ID for all running processes
For Maxwell &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder, jpeg decoder, OFA (Optical Flow Accelerator)
for all running processes. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at
by \a procesesUtilInfo->procUtilArray. One utilization sample structure is returned per process running, that had some non-zero utilization
during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values
are returned as "unsigned int" values.
The caller should allocate a buffer of size processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t). If the buffer is too small, the API will
return \a NVML_ERROR_INSUFFICIENT_SIZE, with the recommended minimal buffer size at \a procesesUtilInfo->processSamplesCount. The caller should
invoke the function again with the allocated buffer passed in \a procesesUtilInfo->procUtilArray, and \a procesesUtilInfo->processSamplesCount
set to the number no less than the recommended value by the previous API return.
On successful return, the function updates \a procesesUtilInfo->processSamplesCount with the number of process utilization info structures
that were actually written. This may differ from a previously read value as instances are created or destroyed.
\a procesesUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a procesesUtilInfo->lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
\a procesesUtilInfo->version is the version number of the structure nvmlProcessesUtilizationInfo_t, the caller should set the correct version
number to retrieve the specific version of processes utilization information.
@note On MIG-enabled GPUs, querying process utilization is not currently supported.
@param device The identifier of the target device
@param procesesUtilInfo Pointer to the caller-provided structure of nvmlProcessesUtilizationInfo_t.
@return
- \ref NVML_SUCCESS if \a procesesUtilInfo->procUtilArray has been populated
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a procesesUtilInfo is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_VERSION_MISMATCH if the version of \a procesesUtilInfo is invalid
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a procesesUtilInfo->procUtilArray is NULL, or the buffer size of procesesUtilInfo->procUtilArray is too small.
The caller should check the minimul array size from the returned procesesUtilInfo->processSamplesCount, and call
the function again with a buffer no smaller than procesesUtilInfo->processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t)
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetProcessesUtilizationInfo(
device: cuda_types::nvml::nvmlDevice_t,
procesesUtilInfo: *mut cuda_types::nvml::nvmlProcessesUtilizationInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the LED state for the unit. The LED can be either green (0) or amber (1).
For S-class products.
Requires root/admin permissions.
This operation takes effect immediately.
<b>Current S-Class products don't provide unique LEDs for each unit. As such, both front
and back LEDs will be toggled in unison regardless of which unit is specified with this command.</b>
See \ref nvmlLedColor_t for available colors.
@param unit The identifier of the target unit
@param color The target LED color
@return
- \ref NVML_SUCCESS if the LED color has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a color is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlUnitGetLedState()*/
fn nvmlUnitSetLedState(
unit: cuda_types::nvml::nvmlUnit_t,
color: cuda_types::nvml::nvmlLedColor_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the persistence mode for the device.
For all products.
For Linux only.
Requires root/admin permissions.
The persistence mode determines whether the GPU driver software is torn down after the last client
exits.
This operation takes effect immediately. It is not persistent across reboots. After each reboot the
persistence mode is reset to "Disabled".
See \ref nvmlEnableState_t for available modes.
After calling this API with mode set to NVML_FEATURE_DISABLED on a device that has its own NUMA
memory, the given device handle will no longer be valid, and to continue to interact with this
device, a new handle should be obtained from one of the nvmlDeviceGetHandleBy*() APIs. This
limitation is currently only applicable to devices that have a coherent NVLink connection to
system memory.
@param device The identifier of the target device
@param mode The target persistence mode
@return
- \ref NVML_SUCCESS if the persistence mode was set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetPersistenceMode()*/
fn nvmlDeviceSetPersistenceMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the compute mode for the device.
For all products.
Requires root/admin permissions.
The compute mode determines whether a GPU can be used for compute operations and whether it can
be shared across contexts.
This operation takes effect immediately. Under Linux it is not persistent across reboots and
always resets to "Default". Under windows it is persistent.
Under windows compute mode may only be set to DEFAULT when running in WDDM
@note On MIG-enabled GPUs, compute mode would be set to DEFAULT and changing it is not supported.
See \ref nvmlComputeMode_t for details on available compute modes.
@param device The identifier of the target device
@param mode The target compute mode
@return
- \ref NVML_SUCCESS if the compute mode was set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetComputeMode()*/
fn nvmlDeviceSetComputeMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: cuda_types::nvml::nvmlComputeMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the ECC mode for the device.
For Kepler &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 1.0 or higher.
Requires root/admin permissions.
The ECC mode determines whether the GPU enables its ECC support.
This operation takes effect after the next reboot.
See \ref nvmlEnableState_t for details on available modes.
@param device The identifier of the target device
@param ecc The target ECC mode
@return
- \ref NVML_SUCCESS if the ECC mode was set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a ecc is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetEccMode()*/
fn nvmlDeviceSetEccMode(
device: cuda_types::nvml::nvmlDevice_t,
ecc: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Clear the ECC error and other memory error counts for the device.
For Kepler &tm; or newer fully supported devices.
Only applicable to devices with ECC.
Requires \a NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts.
Requires \a NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts.
Requires root/admin permissions.
Requires ECC Mode to be enabled.
Sets all of the specified ECC counters to 0, including both detailed and total counts.
This operation takes effect immediately.
See \ref nvmlMemoryErrorType_t for details on available counter types.
@param device The identifier of the target device
@param counterType Flag that indicates which type of errors should be cleared.
@return
- \ref NVML_SUCCESS if the error counts were cleared
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counterType is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see
- nvmlDeviceGetDetailedEccErrors()
- nvmlDeviceGetTotalEccErrors()*/
fn nvmlDeviceClearEccErrorCounts(
device: cuda_types::nvml::nvmlDevice_t,
counterType: cuda_types::nvml::nvmlEccCounterType_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the driver model for the device.
For Fermi &tm; or newer fully supported devices.
For windows only.
Requires root/admin permissions.
On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached
to the device it must run in WDDM mode.
It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce).
This should only be done if the host is subsequently powered down and the display is detached from the device
before the next reboot.
This operation takes effect after the next reboot.
Windows driver model may only be set to WDDM when running in DEFAULT compute mode.
Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or
will not support it after reboot. See \ref nvmlDeviceSetGpuOperationMode.
See \ref nvmlDriverModel_t for details on available driver models.
See \ref nvmlFlagDefault and \ref nvmlFlagForce
@param device The identifier of the target device
@param driverModel The target driver model
@param flags Flags that change the default behavior
@return
- \ref NVML_SUCCESS if the driver model has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a driverModel is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows or the device does not support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetDriverModel()*/
fn nvmlDeviceSetDriverModel(
device: cuda_types::nvml::nvmlDevice_t,
driverModel: cuda_types::nvml::nvmlDriverModel_t,
flags: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set clocks that device will lock to.
Sets the clocks that the device will be running at to the value in the range of minGpuClockMHz to maxGpuClockMHz.
Setting this will supersede application clock values and take effect regardless if a cuda app is running.
See /ref nvmlDeviceSetApplicationsClocks
Can be used as a setting to request constant performance.
This can be called with a pair of integer clock frequencies in MHz, or a pair of /ref nvmlClockLimitId_t values.
See the table below for valid combinations of these values.
minGpuClock | maxGpuClock | Effect
------------+-------------+--------------------------------------------------
tdp | tdp | Lock clock to TDP
unlimited | tdp | Upper bound is TDP but clock may drift below this
tdp | unlimited | Lower bound is TDP but clock may boost above this
unlimited | unlimited | Unlocked (== nvmlDeviceResetGpuLockedClocks)
If one arg takes one of these values, the other must be one of these values as
well. Mixed numeric and symbolic calls return NVML_ERROR_INVALID_ARGUMENT.
Requires root/admin permissions.
After system reboot or driver reload applications clocks go back to their default value.
See \ref nvmlDeviceResetGpuLockedClocks.
For Volta &tm; or newer fully supported devices.
@param device The identifier of the target device
@param minGpuClockMHz Requested minimum gpu clock in MHz
@param maxGpuClockMHz Requested maximum gpu clock in MHz
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz
is not a valid clock combination
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetGpuLockedClocks(
device: cuda_types::nvml::nvmlDevice_t,
minGpuClockMHz: ::core::ffi::c_uint,
maxGpuClockMHz: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Resets the gpu clock to the default value
This is the gpu clock that will be used after system reboot or driver reload.
Default values are idle clocks, but the current values can be changed using \ref nvmlDeviceSetApplicationsClocks.
@see nvmlDeviceSetGpuLockedClocks
For Volta &tm; or newer fully supported devices.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceResetGpuLockedClocks(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set memory clocks that device will lock to.
Sets the device's memory clocks to the value in the range of minMemClockMHz to maxMemClockMHz.
Setting this will supersede application clock values and take effect regardless of whether a cuda app is running.
See /ref nvmlDeviceSetApplicationsClocks
Can be used as a setting to request constant performance.
Requires root/admin permissions.
After system reboot or driver reload applications clocks go back to their default value.
See \ref nvmlDeviceResetMemoryLockedClocks.
For Ampere &tm; or newer fully supported devices.
@param device The identifier of the target device
@param minMemClockMHz Requested minimum memory clock in MHz
@param maxMemClockMHz Requested maximum memory clock in MHz
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz
is not a valid clock combination
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetMemoryLockedClocks(
device: cuda_types::nvml::nvmlDevice_t,
minMemClockMHz: ::core::ffi::c_uint,
maxMemClockMHz: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Resets the memory clock to the default value
This is the memory clock that will be used after system reboot or driver reload.
Default values are idle clocks, but the current values can be changed using \ref nvmlDeviceSetApplicationsClocks.
@see nvmlDeviceSetMemoryLockedClocks
For Ampere &tm; or newer fully supported devices.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceResetMemoryLockedClocks(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set clocks that applications will lock to.
Sets the clocks that compute and graphics applications will be running at.
e.g. CUDA driver requests these clocks during context creation which means this property
defines clocks at which CUDA applications will be running unless some overspec event
occurs (e.g. over power, over thermal or external HW brake).
Can be used as a setting to request constant performance.
On Pascal and newer hardware, this will automatically disable automatic boosting of clocks.
On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call
\ref nvmlDeviceSetAutoBoostedClocksEnabled to prevent clocks from automatically boosting
above the clock value being set.
For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
Requires root/admin permissions.
See \ref nvmlDeviceGetSupportedMemoryClocks and \ref nvmlDeviceGetSupportedGraphicsClocks
for details on how to list available clocks combinations.
After system reboot or driver reload applications clocks go back to their default value.
See \ref nvmlDeviceResetApplicationsClocks.
@param device The identifier of the target device
@param memClockMHz Requested memory clock in MHz
@param graphicsClockMHz Requested graphics clock in MHz
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memClockMHz and \a graphicsClockMHz
is not a valid clock combination
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetApplicationsClocks(
device: cuda_types::nvml::nvmlDevice_t,
memClockMHz: ::core::ffi::c_uint,
graphicsClockMHz: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Resets the application clock to the default value
This is the applications clock that will be used after system reboot or driver reload.
Default value is constant, but the current value an be changed using \ref nvmlDeviceSetApplicationsClocks.
On Pascal and newer hardware, if clocks were previously locked with \ref nvmlDeviceSetApplicationsClocks,
this call will unlock clocks. This returns clocks their default behavior ofautomatically boosting above
base clocks as thermal limits allow.
@see nvmlDeviceGetApplicationsClock
@see nvmlDeviceSetApplicationsClocks
For Fermi &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if new settings were successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceResetApplicationsClocks(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Try to set the current state of Auto Boosted clocks on a device.
For Kepler &tm; or newer fully supported devices.
Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
rates are desired.
Non-root users may use this API by default but can be restricted by root from using this API by calling
\ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS.
Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled.
On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
behavior.
@param device The identifier of the target device
@param enabled What state to try to set Auto Boosted clocks of the target device to
@return
- \ref NVML_SUCCESS If the Auto Boosted clocks were successfully set to the state specified by \a enabled
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceSetAutoBoostedClocksEnabled(
device: cuda_types::nvml::nvmlDevice_t,
enabled: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will
return to when no compute running processes (e.g. CUDA application which have an active context) are running
For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices.
Requires root/admin permissions.
Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates
to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock
rates are desired.
On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks.
Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost
behavior.
@param device The identifier of the target device
@param enabled What state to try to set default Auto Boosted clocks of the target device to
@param flags Flags that change the default behavior. Currently Unused.
@return
- \ref NVML_SUCCESS If the Auto Boosted clock's default state was successfully set to the state specified by \a enabled
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NO_PERMISSION If the calling user does not have permission to change Auto Boosted clock's default state.
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
*/
fn nvmlDeviceSetDefaultAutoBoostedClocksEnabled(
device: cuda_types::nvml::nvmlDevice_t,
enabled: cuda_types::nvml::nvmlEnableState_t,
flags: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets the speed of the fan control policy to default.
For all cuda-capable discrete products with fans
@param device The identifier of the target device
@param fan The index of the fan, starting at zero
return
NVML_SUCCESS if speed has been adjusted
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if device is invalid
NVML_ERROR_NOT_SUPPORTED if the device does not support this
(doesn't have fans)
NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetDefaultFanSpeed_v2(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets current fan control policy.
For Maxwell &tm; or newer fully supported devices.
Requires privileged user.
For all cuda-capable discrete products with fans
device The identifier of the target \a device
policy The fan control \a policy to set
return
NVML_SUCCESS if \a policy has been set
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a policy is null or the \a fan given doesn't reference
a fan that exists.
NVML_ERROR_NOT_SUPPORTED if the \a device is older than Maxwell
NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetFanControlPolicy(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
policy: cuda_types::nvml::nvmlFanControlPolicy_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets the temperature threshold for the GPU with the specified threshold type in degrees C.
For Maxwell &tm; or newer fully supported devices.
See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds.
@param device The identifier of the target device
@param thresholdType The type of threshold value to be set
@param temp Reference which hold the value to be set
@return
- \ref NVML_SUCCESS if \a temp has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a thresholdType is invalid or \a temp is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature sensor or is unsupported
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetTemperatureThreshold(
device: cuda_types::nvml::nvmlDevice_t,
thresholdType: cuda_types::nvml::nvmlTemperatureThresholds_t,
temp: *mut ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set new power limit of this device.
For Kepler &tm; or newer fully supported devices.
Requires root/admin permissions.
See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values.
\note Limit is not persistent across reboots or driver unloads.
Enable persistent mode to prevent driver from unloading when no application is using the device.
@param device The identifier of the target device
@param limit Power management limit in milliwatts to set
@return
- \ref NVML_SUCCESS if \a limit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is out of range
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceGetPowerManagementLimitConstraints
@see nvmlDeviceGetPowerManagementDefaultLimit*/
fn nvmlDeviceSetPowerManagementLimit(
device: cuda_types::nvml::nvmlDevice_t,
limit: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets new GOM. See \a nvmlGpuOperationMode_t for details.
For GK110 M-class and X-class Tesla &tm; products from the Kepler family.
Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products.
Not supported on Quadro ® and Tesla &tm; C-class products.
Requires root/admin permissions.
Changing GOMs requires a reboot.
The reboot requirement might be removed in the future.
Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when
pending driver model is WDDM is not supported. See \ref nvmlDeviceSetDriverModel.
@param device The identifier of the target device
@param mode Target GOM
@return
- \ref NVML_SUCCESS if \a mode has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode incorrect
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support GOM or specific mode
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlGpuOperationMode_t
@see nvmlDeviceGetGpuOperationMode*/
fn nvmlDeviceSetGpuOperationMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: cuda_types::nvml::nvmlGpuOperationMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs.
This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs.
The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction
to query the current restriction settings.
For Kepler &tm; or newer fully supported devices.
Requires root/admin permissions.
@param device The identifier of the target device
@param apiType Target API type for this operation
@param isRestricted The target restriction
@return
- \ref NVML_SUCCESS if \a isRestricted has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a apiType incorrect
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support changing API restrictions or the device does not support
the feature that api restrictions are being set for (E.G. Enabling/disabling auto
boosted clocks is not supported by the device)
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlRestrictedAPI_t*/
fn nvmlDeviceSetAPIRestriction(
device: cuda_types::nvml::nvmlDevice_t,
apiType: cuda_types::nvml::nvmlRestrictedAPI_t,
isRestricted: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets the speed of a specified fan.
WARNING: This function changes the fan control policy to manual. It means that YOU have to monitor
the temperature and adjust the fan speed accordingly.
If you set the fan speed too low you can burn your GPU!
Use nvmlDeviceSetDefaultFanSpeed_v2 to restore default control policy.
For all cuda-capable discrete products with fans that are Maxwell or Newer.
device The identifier of the target device
fan The index of the fan, starting at zero
speed The target speed of the fan [0-100] in % of max speed
return
NVML_SUCCESS if the fan speed has been set
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if the device is not valid, or the speed is outside acceptable ranges,
or if the fan index doesn't reference an actual fan.
NVML_ERROR_NOT_SUPPORTED if the device is older than Maxwell.
NVML_ERROR_UNKNOWN if there was an unexpected error.*/
fn nvmlDeviceSetFanSpeed_v2(
device: cuda_types::nvml::nvmlDevice_t,
fan: ::core::ffi::c_uint,
speed: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the GPCCLK VF offset value
@param[in] device The identifier of the target device
@param[in] offset The GPCCLK VF offset value to set
@return
- \ref NVML_SUCCESS if \a offset has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetGpcClkVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
offset: ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the MemClk (Memory Clock) VF offset value. It requires elevated privileges.
@param[in] device The identifier of the target device
@param[in] offset The MemClk VF offset value to set
@return
- \ref NVML_SUCCESS if \a offset has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetMemClkVfOffset(
device: cuda_types::nvml::nvmlDevice_t,
offset: ::core::ffi::c_int,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set Conf Computing Unprotected Memory Size.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param device Device Handle
@param sizeKiB Unprotected Memory size to be set in KiB
@return
- \ref NVML_SUCCESS if \a sizeKiB successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlDeviceSetConfComputeUnprotectedMemSize(
device: cuda_types::nvml::nvmlDevice_t,
sizeKiB: ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set Conf Computing GPUs ready state.
For Ampere &tm; or newer fully supported devices.
Supported on Linux, Windows TCC.
@param isAcceptingWork GPU accepting new work, NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or
NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE
return
- \ref NVML_SUCCESS if \a current GPUs ready state is successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a isAcceptingWork is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlSystemSetConfComputeGpusReadyState(
isAcceptingWork: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set Conf Computing key rotation threshold.
%HOPPER_OR_NEWER%
Supported on Linux, Windows TCC.
This function is to set the confidential compute key rotation threshold parameters.
@ref pKeyRotationThrInfo->maxAttackerAdvantage should be in the range from
NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MIN to NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MAX.
Default value is 60.
@param pKeyRotationThrInfo Reference to the key rotation threshold data
@return
- \ref NVML_SUCCESS if \a key rotation threashold max attacker advantage has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL
- \ref NVML_ERROR_INVALID_STATE if confidential compute GPU ready state is enabled
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlSystemSetConfComputeKeyRotationThresholdInfo(
pKeyRotationThrInfo: *mut cuda_types::nvml::nvmlConfComputeSetKeyRotationThresholdInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Enables or disables per process accounting.
For Kepler &tm; or newer fully supported devices.
Requires root/admin permissions.
@note This setting is not persistent and will default to disabled after driver unloads.
Enable persistence mode to be sure the setting doesn't switch off to disabled.
@note Enabling accounting mode has no negative impact on the GPU performance.
@note Disabling accounting clears all accounting pids information.
@note On MIG-enabled GPUs, accounting mode would be set to DISABLED and changing it is not supported.
See \ref nvmlDeviceGetAccountingMode
See \ref nvmlDeviceGetAccountingStats
See \ref nvmlDeviceClearAccountingPids
@param device The identifier of the target device
@param mode The target accounting mode
@return
- \ref NVML_SUCCESS if the new mode has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a mode are invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetAccountingMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Clears accounting information about all processes that have already terminated.
For Kepler &tm; or newer fully supported devices.
Requires root/admin permissions.
See \ref nvmlDeviceGetAccountingMode
See \ref nvmlDeviceGetAccountingStats
See \ref nvmlDeviceSetAccountingMode
@param device The identifier of the target device
@return
- \ref NVML_SUCCESS if accounting information has been cleared
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device are invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceClearAccountingPids(
device: cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the state of the device's NvLink for the link specified
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param isActive \a nvmlEnableState_t where NVML_FEATURE_ENABLED indicates that
the link is active and NVML_FEATURE_DISABLED indicates it
is inactive
@return
- \ref NVML_SUCCESS if \a isActive has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a isActive is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkState(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
isActive: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the version of the device's NvLink for the link specified
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param version Requested NvLink version
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a version is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkVersion(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
version: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the requested capability from the device's NvLink for the link specified
Please refer to the \a nvmlNvLinkCapability_t structure for the specific caps that can be queried
The return value should be treated as a boolean.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param capability Specifies the \a nvmlNvLinkCapability_t to be queried
@param capResult A boolean for the queried capability indicating that feature is available
@return
- \ref NVML_SUCCESS if \a capResult has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a capability is invalid or \a capResult is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkCapability(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
capability: cuda_types::nvml::nvmlNvLinkCapability_t,
capResult: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the PCI information for the remote node on a NvLink link
Note: pciSubSystemId is not filled in this function and is indeterminate
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param pci \a nvmlPciInfo_t of the remote node for the specified link
@return
- \ref NVML_SUCCESS if \a pci has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a pci is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkRemotePciInfo_v2(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
pci: *mut cuda_types::nvml::nvmlPciInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the specified error counter value
Please refer to \a nvmlNvLinkErrorCounter_t for error counters that are available
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param counter Specifies the NvLink counter to be queried
@param counterValue Returned counter value
@return
- \ref NVML_SUCCESS if \a counter has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid or \a counterValue is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkErrorCounter(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: cuda_types::nvml::nvmlNvLinkErrorCounter_t,
counterValue: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Resets all error counters to zero
Please refer to \a nvmlNvLinkErrorCounter_t for the list of error counters that are reset
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@return
- \ref NVML_SUCCESS if the reset is successful
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceResetNvLinkErrorCounters(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Setting utilization counter control is no longer supported.
Set the NVLINK utilization counter control information for the specified counter, 0 or 1.
Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition. Performs a reset
of the counters if the reset parameter is non-zero.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param counter Specifies the counter that should be set (0 or 1).
@param link Specifies the NvLink link to be queried
@param control A reference to the \a nvmlNvLinkUtilizationControl_t to set
@param reset Resets the counters on set if non-zero
@return
- \ref NVML_SUCCESS if the control has been set successfully
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetNvLinkUtilizationControl(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: ::core::ffi::c_uint,
control: *mut cuda_types::nvml::nvmlNvLinkUtilizationControl_t,
reset: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Getting utilization counter control is no longer supported.
Get the NVLINK utilization counter control information for the specified counter, 0 or 1.
Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param counter Specifies the counter that should be set (0 or 1).
@param link Specifies the NvLink link to be queried
@param control A reference to the \a nvmlNvLinkUtilizationControl_t to place information
@return
- \ref NVML_SUCCESS if the control has been set successfully
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkUtilizationControl(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: ::core::ffi::c_uint,
control: *mut cuda_types::nvml::nvmlNvLinkUtilizationControl_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Use \ref nvmlDeviceGetFieldValues with NVML_FI_DEV_NVLINK_THROUGHPUT_* as field values instead.
Retrieve the NVLINK utilization counter based on the current control for a specified counter.
In general it is good practice to use \a nvmlDeviceSetNvLinkUtilizationControl
before reading the utilization counters as they have no default state
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param counter Specifies the counter that should be read (0 or 1).
@param rxcounter Receive counter return value
@param txcounter Transmit counter return value
@return
- \ref NVML_SUCCESS if \a rxcounter and \a txcounter have been successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, or \a link is invalid or \a rxcounter or \a txcounter are NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkUtilizationCounter(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: ::core::ffi::c_uint,
rxcounter: *mut ::core::ffi::c_ulonglong,
txcounter: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Freezing NVLINK utilization counters is no longer supported.
Freeze the NVLINK utilization counters
Both the receive and transmit counters are operated on by this function
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be queried
@param counter Specifies the counter that should be frozen (0 or 1).
@param freeze NVML_FEATURE_ENABLED = freeze the receive and transmit counters
NVML_FEATURE_DISABLED = unfreeze the receive and transmit counters
@return
- \ref NVML_SUCCESS if counters were successfully frozen or unfrozen
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, \a counter, or \a freeze is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceFreezeNvLinkUtilizationCounter(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: ::core::ffi::c_uint,
freeze: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Deprecated: Resetting NVLINK utilization counters is no longer supported.
Reset the NVLINK utilization counters
Both the receive and transmit counters are operated on by this function
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target device
@param link Specifies the NvLink link to be reset
@param counter Specifies the counter that should be reset (0 or 1)
@return
- \ref NVML_SUCCESS if counters were successfully reset
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceResetNvLinkUtilizationCounter(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
counter: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the NVLink device type of the remote device connected over the given link.
@param device The device handle of the target GPU
@param link The NVLink link index on the target GPU
@param pNvLinkDeviceType Pointer in which the output remote device type is returned
@return
- \ref NVML_SUCCESS if \a pNvLinkDeviceType has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_SUPPORTED if NVLink is not supported
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid, or
\a pNvLinkDeviceType is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetNvLinkRemoteDeviceType(
device: cuda_types::nvml::nvmlDevice_t,
link: ::core::ffi::c_uint,
pNvLinkDeviceType: *mut cuda_types::nvml::nvmlIntNvLinkDeviceType_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Create an empty set of events.
Event set should be freed by \ref nvmlEventSetFree
For Fermi &tm; or newer fully supported devices.
@param set Reference in which to return the event handle
@return
- \ref NVML_SUCCESS if the event has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a set is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlEventSetFree*/
fn nvmlEventSetCreate(
set: *mut cuda_types::nvml::nvmlEventSet_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Starts recording of events on a specified devices and add the events to specified \ref nvmlEventSet_t
For Fermi &tm; or newer fully supported devices.
Ecc events are available only on ECC enabled devices (see \ref nvmlDeviceGetTotalEccErrors)
Power capping events are available only on Power Management enabled devices (see \ref nvmlDeviceGetPowerManagementMode)
For Linux only.
\b IMPORTANT: Operations on \a set are not thread safe
This call starts recording of events on specific device.
All events that occurred before this call are not recorded.
Checking if some event occurred can be done with \ref nvmlEventSetWait_v2
If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed.
If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes
are registered in that case.
@param device The identifier of the target device
@param eventTypes Bitmask of \ref nvmlEventType to record
@param set Set to which add new event types
@return
- \ref NVML_SUCCESS if the event has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a eventTypes is invalid or \a set is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the platform does not support this feature or some of requested event types
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlEventType
@see nvmlDeviceGetSupportedEventTypes
@see nvmlEventSetWait
@see nvmlEventSetFree*/
fn nvmlDeviceRegisterEvents(
device: cuda_types::nvml::nvmlDevice_t,
eventTypes: ::core::ffi::c_ulonglong,
set: cuda_types::nvml::nvmlEventSet_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns information about events supported on device
For Fermi &tm; or newer fully supported devices.
Events are not supported on Windows. So this function returns an empty mask in \a eventTypes on Windows.
@param device The identifier of the target device
@param eventTypes Reference in which to return bitmask of supported events
@return
- \ref NVML_SUCCESS if the eventTypes has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a eventType is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlEventType
@see nvmlDeviceRegisterEvents*/
fn nvmlDeviceGetSupportedEventTypes(
device: cuda_types::nvml::nvmlDevice_t,
eventTypes: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Waits on events and delivers events
For Fermi &tm; or newer fully supported devices.
If some events are ready to be delivered at the time of the call, function returns immediately.
If there are no events ready to be delivered, function sleeps till event arrives
but not longer than specified timeout. This function in certain conditions can return before
specified timeout passes (e.g. when interrupt arrives)
On Windows, in case of xid error, the function returns the most recent xid error type seen by the system.
If there are multiple xid errors generated before nvmlEventSetWait is invoked then the last seen xid error
type is returned for all xid error events.
On Linux, every xid error event would return the associated event data and other information if applicable.
In MIG mode, if device handle is provided, the API reports all the events for the available instances,
only if the caller has appropriate privileges. In absence of required privileges, only the events which
affect all the instances (i.e. whole device) are reported.
This API does not currently support per-instance event reporting using MIG device handles.
@param set Reference to set of events to wait on
@param data Reference in which to return event data
@param timeoutms Maximum amount of wait time in milliseconds for registered event
@return
- \ref NVML_SUCCESS if the data has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a data is NULL
- \ref NVML_ERROR_TIMEOUT if no event arrived in specified timeout or interrupt arrived
- \ref NVML_ERROR_GPU_IS_LOST if a GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlEventType
@see nvmlDeviceRegisterEvents*/
fn nvmlEventSetWait_v2(
set: cuda_types::nvml::nvmlEventSet_t,
data: *mut cuda_types::nvml::nvmlEventData_t,
timeoutms: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Releases events in the set
For Fermi &tm; or newer fully supported devices.
@param set Reference to events to be released
@return
- \ref NVML_SUCCESS if the event has been successfully released
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlDeviceRegisterEvents*/
fn nvmlEventSetFree(
set: cuda_types::nvml::nvmlEventSet_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests.
Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before
this call is made.
Must be called as administrator.
For Linux only.
For Pascal &tm; or newer fully supported devices.
Some Kepler devices supported.
@param pciInfo The PCI address of the GPU drain state to be modified
@param newState The drain state that should be entered, see \ref nvmlEnableState_t
@return
- \ref NVML_SUCCESS if counters were successfully reset
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a newState is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation
- \ref NVML_ERROR_IN_USE if the device has persistence mode turned on
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceModifyDrainState(
pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t,
newState: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining
state.
For Linux only.
For Pascal &tm; or newer fully supported devices.
Some Kepler devices supported.
@param pciInfo The PCI address of the GPU drain state to be queried
@param currentState The current drain state for this GPU, see \ref nvmlEnableState_t
@return
- \ref NVML_SUCCESS if counters were successfully reset
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a currentState is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceQueryDrainState(
pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t,
currentState: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver
as long as no other processes are attached. If other processes are attached, this call will return
NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the
only situation where a process can still be attached after nvmlDeviceModifyDrainState() is called
to initiate the draining state is if that process was using, and is still using, a GPU before the
call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled
prior to this call.
For long-running NVML processes please note that this will change the enumeration of current GPUs.
For example, if there are four GPUs present and GPU1 is removed, the new enumeration will be 0-2.
Also, device handles after the removed GPU will not be valid and must be re-established.
Must be run as administrator.
For Linux only.
For Pascal &tm; or newer fully supported devices.
Some Kepler devices supported.
@param pciInfo The PCI address of the GPU to be removed
@param gpuState Whether the GPU is to be removed, from the OS
see \ref nvmlDetachGpuState_t
@param linkState Requested upstream PCIe link state, see \ref nvmlPcieLinkState_t
@return
- \ref NVML_SUCCESS if counters were successfully reset
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- \ref NVML_ERROR_IN_USE if the device is still in use and cannot be removed*/
fn nvmlDeviceRemoveGpu_v2(
pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t,
gpuState: cuda_types::nvml::nvmlDetachGpuState_t,
linkState: cuda_types::nvml::nvmlPcieLinkState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that
were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device.
If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes
the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order.
In addition, all newly discovered GPUs will be initialized and their ECC scrubbed which may take several seconds
per GPU. Also, all device handles are no longer guaranteed to be valid post discovery.
Must be run as administrator.
For Linux only.
For Pascal &tm; or newer fully supported devices.
Some Kepler devices supported.
@param pciInfo The PCI tree to be searched. Only the domain, bus, and device
fields are used in this call.
@return
- \ref NVML_SUCCESS if counters were successfully reset
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pciInfo is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if the operating system does not support this feature
- \ref NVML_ERROR_OPERATING_SYSTEM if the operating system is denying this feature
- \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceDiscoverGpus(
pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Request values for a list of fields for a device. This API allows multiple fields to be queried at once.
If any of the underlying fieldIds are populated by the same driver call, the results for those field IDs
will be populated from a single call rather than making a driver call for each fieldId.
@param device The device handle of the GPU to request field values for
@param valuesCount Number of entries in values that should be retrieved
@param values Array of \a valuesCount structures to hold field values.
Each value's fieldId must be populated prior to this call
@return
- \ref NVML_SUCCESS if any values in \a values were populated. Note that you must
check the nvmlReturn field of each value for each individual
status
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a values is NULL*/
fn nvmlDeviceGetFieldValues(
device: cuda_types::nvml::nvmlDevice_t,
valuesCount: ::core::ffi::c_int,
values: *mut cuda_types::nvml::nvmlFieldValue_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Clear values for a list of fields for a device. This API allows multiple fields to be cleared at once.
@param device The device handle of the GPU to request field values for
@param valuesCount Number of entries in values that should be cleared
@param values Array of \a valuesCount structures to hold field values.
Each value's fieldId must be populated prior to this call
@return
- \ref NVML_SUCCESS if any values in \a values were cleared. Note that you must
check the nvmlReturn field of each value for each individual
status
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a values is NULL*/
fn nvmlDeviceClearFieldValues(
device: cuda_types::nvml::nvmlDevice_t,
valuesCount: ::core::ffi::c_int,
values: *mut cuda_types::nvml::nvmlFieldValue_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** This method is used to get the virtualization mode corresponding to the GPU.
For Kepler &tm; or newer fully supported devices.
@param device Identifier of the target device
@param pVirtualMode Reference to virtualization mode. One of NVML_GPU_VIRTUALIZATION_?
@return
- \ref NVML_SUCCESS if \a pVirtualMode is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pVirtualMode is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVirtualizationMode(
device: cuda_types::nvml::nvmlDevice_t,
pVirtualMode: *mut cuda_types::nvml::nvmlGpuVirtualizationMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries if SR-IOV host operation is supported on a vGPU supported device.
Checks whether SR-IOV host capability is supported by the device and the
driver, and indicates device is in SR-IOV mode if both of these conditions
are true.
@param device The identifier of the target device
@param pHostVgpuMode Reference in which to return the current vGPU mode
@return
- \ref NVML_SUCCESS if device's vGPU mode has been successfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle is 0 or \a pVgpuMode is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature.
- \ref NVML_ERROR_UNKNOWN if any unexpected error occurred*/
fn nvmlDeviceGetHostVgpuMode(
device: cuda_types::nvml::nvmlDevice_t,
pHostVgpuMode: *mut cuda_types::nvml::nvmlHostVgpuMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** This method is used to set the virtualization mode corresponding to the GPU.
For Kepler &tm; or newer fully supported devices.
@param device Identifier of the target device
@param virtualMode virtualization mode. One of NVML_GPU_VIRTUALIZATION_?
@return
- \ref NVML_SUCCESS if \a virtualMode is set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a virtualMode is NULL
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_SUPPORTED if setting of virtualization mode is not supported.
- \ref NVML_ERROR_NO_PERMISSION if setting of virtualization mode is not allowed for this client.*/
fn nvmlDeviceSetVirtualizationMode(
device: cuda_types::nvml::nvmlDevice_t,
virtualMode: cuda_types::nvml::nvmlGpuVirtualizationMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the vGPU heterogeneous mode for the device.
When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes.
On successful return, the function returns \a pHeterogeneousMode->mode with the current vGPU heterogeneous mode.
\a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should
set the correct version number to retrieve the vGPU heterogeneous mode.
\a pHeterogeneousMode->mode can either be \ref NVML_FEATURE_ENABLED or \ref NVML_FEATURE_DISABLED.
@param device The identifier of the target device
@param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pHeterogeneousMode is NULL
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support this feature
- \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceGetVgpuHeterogeneousMode(
device: cuda_types::nvml::nvmlDevice_t,
pHeterogeneousMode: *mut cuda_types::nvml::nvmlVgpuHeterogeneousMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Enable or disable vGPU heterogeneous mode for the device.
When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes.
API would return an appropriate error code upon unsuccessful activation. For example, the heterogeneous mode
set will fail with error \ref NVML_ERROR_IN_USE if any vGPU instance is active on the device. The caller of this API
is expected to shutdown the vGPU VMs and retry setting the \a mode.
On successful return, the function updates the vGPU heterogeneous mode with the user provided \a pHeterogeneousMode->mode.
\a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should
set the correct version number to set the vGPU heterogeneous mode.
@param device Identifier of the target device
@param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a pHeterogeneousMode is NULL or \a pHeterogeneousMode->mode is invalid
- \ref NVML_ERROR_IN_USE If the \a device is in use
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device doesn't support this feature
- \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceSetVgpuHeterogeneousMode(
device: cuda_types::nvml::nvmlDevice_t,
pHeterogeneousMode: *const cuda_types::nvml::nvmlVgpuHeterogeneousMode_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the placement ID of active vGPU instance.
When in vGPU heterogeneous mode, this function returns a valid placement ID as \a pPlacement->placementId
else NVML_INVALID_VGPU_PLACEMENT_ID is returned.
\a pPlacement->version is the version number of the structure nvmlVgpuPlacementId_t, the caller should
set the correct version number to get placement id of the vGPU instance \a vgpuInstance.
@param vgpuInstance Identifier of the target vGPU instance
@param pPlacement Pointer to vGPU placement ID structure \a nvmlVgpuPlacementId_t
@return
- \ref NVML_SUCCESS If information is successfully retrieved
- \ref NVML_ERROR_NOT_FOUND If \a vgpuInstance does not match a valid active vGPU instance
- \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuInstance is invalid or \a pPlacement is NULL
- \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacement is invalid
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlVgpuInstanceGetPlacementId(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
pPlacement: *mut cuda_types::nvml::nvmlVgpuPlacementId_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the supported vGPU placement ID of the vGPU type.
An array of supported vGPU placement IDs for the vGPU type ID indicated by \a vgpuTypeId is returned in the
caller-supplied buffer of \a pPlacementList->placementIds. Memory needed for the placementIds array should be
allocated based on maximum instances of a vGPU type which can be queried via \ref nvmlVgpuTypeGetMaxInstances().
This function will return supported placement IDs even if GPU is not in vGPU heterogeneous mode.
@param device Identifier of the target device
@param vgpuTypeId Handle to vGPU type. The vGPU type ID
@param pPlacementList Pointer to the vGPU placement structure \a nvmlVgpuPlacementList_t
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL
- \ref NVML_ERROR_NOT_SUPPORTED If \a device or \a vgpuTypeId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacementList is invalid
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceGetVgpuTypeSupportedPlacements(
device: cuda_types::nvml::nvmlDevice_t,
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
pPlacementList: *mut cuda_types::nvml::nvmlVgpuPlacementList_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the creatable vGPU placement ID of the vGPU type.
An array of creatable vGPU placement IDs for the vGPU type ID indicated by \a vgpuTypeId is returned in the
caller-supplied buffer of \a pPlacementList->placementIds. Memory needed for the placementIds array should be
allocated based on maximum instances of a vGPU type which can be queried via \ref nvmlVgpuTypeGetMaxInstances().
The creatable vGPU placement IDs may differ over time, as there may be restrictions on what type of vGPU the
vGPU instance is running.
The function will return \ref NVML_ERROR_NOT_SUPPORTED if the \a device is not in vGPU heterogeneous mode.
@param device The identifier of the target device
@param vgpuTypeId Handle to vGPU type. The vGPU type ID
@param pPlacementList Pointer to the list of vGPU placement structure \a nvmlVgpuPlacementList_t
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL
- \ref NVML_ERROR_NOT_SUPPORTED If \a device or \a vgpuTypeId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_VERSION_MISMATCH If the version of \a pPlacementList is invalid
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceGetVgpuTypeCreatablePlacements(
device: cuda_types::nvml::nvmlDevice_t,
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
pPlacementList: *mut cuda_types::nvml::nvmlVgpuPlacementList_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the static GSP heap size of the vGPU type in bytes
@param vgpuTypeId Handle to vGPU type
@param gspHeapSize Reference to return the GSP heap size value
@return
- \ref NVML_SUCCESS Successful completion
- \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a gspHeapSize is NULL
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlVgpuTypeGetGspHeapSize(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
gspHeapSize: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the static framebuffer reservation of the vGPU type in bytes
@param vgpuTypeId Handle to vGPU type
@param fbReservation Reference to return the framebuffer reservation
@return
- \ref NVML_SUCCESS Successful completion
- \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a fbReservation is NULL
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlVgpuTypeGetFbReservation(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
fbReservation: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the desirable vGPU capability of a device
Refer to the \a nvmlDeviceVgpuCapability_t structure for the specific capabilities that can be set.
See \ref nvmlEnableState_t for available state.
@param device The identifier of the target device
@param capability Specifies the \a nvmlDeviceVgpuCapability_t to be set
@param state The target capability mode
@return
- \ref NVML_SUCCESS Successful completion
- \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, or \a capability is invalid, or \a state is invalid
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state, or \a device not in vGPU mode
- \ref NVML_ERROR_UNKNOWN On any unexpected error*/
fn nvmlDeviceSetVgpuCapabilities(
device: cuda_types::nvml::nvmlDevice_t,
capability: cuda_types::nvml::nvmlDeviceVgpuCapability_t,
state: cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the vGPU Software licensable features.
Identifies whether the system supports vGPU Software Licensing. If it does, return the list of licensable feature(s)
and their current license status.
@param device Identifier of the target device
@param pGridLicensableFeatures Pointer to structure in which vGPU software licensable features are returned
@return
- \ref NVML_SUCCESS if licensable features are successfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pGridLicensableFeatures is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGridLicensableFeatures_v4(
device: cuda_types::nvml::nvmlDevice_t,
pGridLicensableFeatures: *mut cuda_types::nvml::nvmlGridLicensableFeatures_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the requested vGPU driver capability.
Refer to the \a nvmlVgpuDriverCapability_t structure for the specific capabilities that can be queried.
The return value in \a capResult should be treated as a boolean, with a non-zero value indicating that the capability
is supported.
For Maxwell &tm; or newer fully supported devices.
@param capability Specifies the \a nvmlVgpuDriverCapability_t to be queried
@param capResult A boolean for the queried capability indicating that feature is supported
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a capability is invalid, or \a capResult is NULL
- \ref NVML_ERROR_NOT_SUPPORTED the API is not supported in current state or \a devices not in vGPU mode
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlGetVgpuDriverCapabilities(
capability: cuda_types::nvml::nvmlVgpuDriverCapability_t,
capResult: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the requested vGPU capability for GPU.
Refer to the \a nvmlDeviceVgpuCapability_t structure for the specific capabilities that can be queried.
The return value in \a capResult reports a non-zero value indicating that the capability
is supported, and also reports the capability's data based on the queried capability.
For Maxwell &tm; or newer fully supported devices.
@param device The identifier of the target device
@param capability Specifies the \a nvmlDeviceVgpuCapability_t to be queried
@param capResult Specifies that the queried capability is supported, and also returns capability's data
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a capability is invalid, or \a capResult is NULL
- \ref NVML_ERROR_NOT_SUPPORTED the API is not supported in current state or \a device not in vGPU mode
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuCapabilities(
device: cuda_types::nvml::nvmlDevice_t,
capability: cuda_types::nvml::nvmlDeviceVgpuCapability_t,
capResult: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the supported vGPU types on a physical GPU (device).
An array of supported vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer
pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount
is used to return the number of vGPU types written to the buffer.
If the supplied buffer is not large enough to accommodate the vGPU type array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount.
To query the number of vGPU types supported for the GPU, call this function with *vgpuCount = 0.
The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are supported.
@param device The identifier of the target device
@param vgpuCount Pointer to caller-supplied array size, and returns number of vGPU types
@param vgpuTypeIds Pointer to caller-supplied array in which to return list of vGPU types
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_INSUFFICIENT_SIZE \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuCount is NULL or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetSupportedVgpus(
device: cuda_types::nvml::nvmlDevice_t,
vgpuCount: *mut ::core::ffi::c_uint,
vgpuTypeIds: *mut cuda_types::nvml::nvmlVgpuTypeId_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the currently creatable vGPU types on a physical GPU (device).
An array of creatable vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer
pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount
is used to return the number of vGPU types written to the buffer.
The creatable vGPU types for a device may differ over time, as there may be restrictions on what type of vGPU types
can concurrently run on a device. For example, if only one vGPU type is allowed at a time on a device, then the creatable
list will be restricted to whatever vGPU type is already running on the device.
If the supplied buffer is not large enough to accommodate the vGPU type array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount.
To query the number of vGPU types that can be created for the GPU, call this function with *vgpuCount = 0.
The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are creatable.
@param device The identifier of the target device
@param vgpuCount Pointer to caller-supplied array size, and returns number of vGPU types
@param vgpuTypeIds Pointer to caller-supplied array in which to return list of vGPU types
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_INSUFFICIENT_SIZE \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuCount is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetCreatableVgpus(
device: cuda_types::nvml::nvmlDevice_t,
vgpuCount: *mut ::core::ffi::c_uint,
vgpuTypeIds: *mut cuda_types::nvml::nvmlVgpuTypeId_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator).
See \ref nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param vgpuTypeClass Pointer to string array to return class in
@param size Size of string
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuTypeClass is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetClass(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
vgpuTypeClass: *mut ::core::ffi::c_char,
size: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the vGPU type name.
The name is an alphanumeric string that denotes a particular vGPU, e.g. GRID M60-2Q. It will not
exceed 64 characters in length (including the NUL terminator). See \ref
nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param vgpuTypeName Pointer to buffer to return name
@param size Size of buffer
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a name is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetName(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
vgpuTypeName: *mut ::core::ffi::c_char,
size: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the GPU Instance Profile ID for the given vGPU type ID.
The API will return a valid GPU Instance Profile ID for the MIG capable vGPU types, else INVALID_GPU_INSTANCE_PROFILE_ID is
returned.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param gpuInstanceProfileId GPU Instance Profile ID
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_NOT_SUPPORTED if \a device is not in vGPU Host virtualization mode
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a gpuInstanceProfileId is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetGpuInstanceProfileId(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
gpuInstanceProfileId: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the device ID of a vGPU type.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param deviceID Device ID and vendor ID of the device contained in single 32 bit value
@param subsystemID Subsystem ID and subsystem vendor ID of the device contained in single 32 bit value
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a deviceId or \a subsystemID are NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetDeviceID(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
deviceID: *mut ::core::ffi::c_ulonglong,
subsystemID: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the vGPU framebuffer size in bytes.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param fbSize Pointer to framebuffer size in bytes
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a fbSize is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetFramebufferSize(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
fbSize: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve count of vGPU's supported display heads.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param numDisplayHeads Pointer to number of display heads
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a numDisplayHeads is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetNumDisplayHeads(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
numDisplayHeads: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve vGPU display head's maximum supported resolution.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param displayIndex Zero-based index of display head
@param xdim Pointer to maximum number of pixels in X dimension
@param ydim Pointer to maximum number of pixels in Y dimension
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a xdim or \a ydim are NULL, or \a displayIndex
is out of range.
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetResolution(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
displayIndex: ::core::ffi::c_uint,
xdim: *mut ::core::ffi::c_uint,
ydim: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve license requirements for a vGPU type
The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form
"<license name>,<version>", for example "GRID-Virtual-PC,2.0". If a vGPU is runnable with* more than one type of license,
the licenses are delimited by a semicolon, for example "GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0".
The total length of the returned string will not exceed 128 characters, including the NUL terminator.
See \ref nvmlVgpuConstants::NVML_GRID_LICENSE_BUFFER_SIZE.
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param vgpuTypeLicenseString Pointer to buffer to return license info
@param size Size of \a vgpuTypeLicenseString buffer
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuTypeLicenseString is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetLicense(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
vgpuTypeLicenseString: *mut ::core::ffi::c_char,
size: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the static frame rate limit value of the vGPU type
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param frameRateLimit Reference to return the frame rate limit value
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_NOT_SUPPORTED if frame rate limiter is turned off for the vGPU type
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a frameRateLimit is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetFrameRateLimit(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
frameRateLimit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the maximum number of vGPU instances creatable on a device for given vGPU type
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param vgpuTypeId Handle to vGPU type
@param vgpuInstanceCount Pointer to get the max number of vGPU instances
that can be created on a deicve for given vgpuTypeId
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid or is not supported on target device,
or \a vgpuInstanceCount is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetMaxInstances(
device: cuda_types::nvml::nvmlDevice_t,
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
vgpuInstanceCount: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the maximum number of vGPU instances supported per VM for given vGPU type
For Kepler &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param vgpuInstanceCountPerVm Pointer to get the max number of vGPU instances supported per VM for given \a vgpuTypeId
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuInstanceCountPerVm is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetMaxInstancesPerVm(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
vgpuInstanceCountPerVm: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the active vGPU instances on a device.
An array of active vGPU instances is returned in the caller-supplied buffer pointed at by \a vgpuInstances. The
array element count is passed in \a vgpuCount, and \a vgpuCount is used to return the number of vGPU instances
written to the buffer.
If the supplied buffer is not large enough to accommodate the vGPU instance array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuInstance_t array required in \a vgpuCount.
To query the number of active vGPU instances, call this function with *vgpuCount = 0. The code will return
NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU Types are supported.
For Kepler &tm; or newer fully supported devices.
@param device The identifier of the target device
@param vgpuCount Pointer which passes in the array size as well as get
back the number of types
@param vgpuInstances Pointer to array in which to return list of vGPU instances
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a vgpuCount is NULL
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetActiveVgpus(
device: cuda_types::nvml::nvmlDevice_t,
vgpuCount: *mut ::core::ffi::c_uint,
vgpuInstances: *mut cuda_types::nvml::nvmlVgpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the VM ID associated with a vGPU instance.
The VM ID is returned as a string, not exceeding 80 characters in length (including the NUL terminator).
See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
The format of the VM ID varies by platform, and is indicated by the type identifier returned in \a vmIdType.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param vmId Pointer to caller-supplied buffer to hold VM ID
@param size Size of buffer in bytes
@param vmIdType Pointer to hold VM ID type
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vmId or \a vmIdType is NULL, or \a vgpuInstance is 0
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetVmID(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
vmId: *mut ::core::ffi::c_char,
size: ::core::ffi::c_uint,
vmIdType: *mut cuda_types::nvml::nvmlVgpuVmIdType_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the UUID of a vGPU instance.
The UUID is a globally unique identifier associated with the vGPU, and is returned as a 5-part hexadecimal string,
not exceeding 80 characters in length (including the NULL terminator).
See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param uuid Pointer to caller-supplied buffer to hold vGPU UUID
@param size Size of buffer in bytes
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a uuid is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetUUID(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
uuid: *mut ::core::ffi::c_char,
size: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the NVIDIA driver version installed in the VM associated with a vGPU.
The version is returned as an alphanumeric string in the caller-supplied buffer \a version. The length of the version
string will not exceed 80 characters in length (including the NUL terminator).
See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE.
nvmlVgpuInstanceGetVmDriverVersion() may be called at any time for a vGPU instance. The guest VM driver version is
returned as "Not Available" if no NVIDIA driver is installed in the VM, or the VM has not yet booted to the point where the
NVIDIA driver is loaded and initialized.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param version Caller-supplied buffer to return driver version string
@param length Size of \a version buffer
@return
- \ref NVML_SUCCESS if \a version has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetVmDriverVersion(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
version: *mut ::core::ffi::c_char,
length: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the framebuffer usage in bytes.
Framebuffer usage is the amont of vGPU framebuffer memory that is currently in use by the VM.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance The identifier of the target instance
@param fbUsage Pointer to framebuffer usage in bytes
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a fbUsage is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetFbUsage(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
fbUsage: *mut ::core::ffi::c_ulonglong,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** @deprecated Use \ref nvmlVgpuInstanceGetLicenseInfo_v2.
Retrieve the current licensing state of the vGPU instance.
If the vGPU is currently licensed, \a licensed is set to 1, otherwise it is set to 0.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param licensed Reference to return the licensing status
@return
- \ref NVML_SUCCESS if \a licensed has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a licensed is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetLicenseStatus(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
licensed: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the vGPU type of a vGPU instance.
Returns the vGPU type ID of vgpu assigned to the vGPU instance.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param vgpuTypeId Reference to return the vgpuTypeId
@return
- \ref NVML_SUCCESS if \a vgpuTypeId has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a vgpuTypeId is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetType(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
vgpuTypeId: *mut cuda_types::nvml::nvmlVgpuTypeId_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the frame rate limit set for the vGPU instance.
Returns the value of the frame rate limit set for the vGPU instance
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param frameRateLimit Reference to return the frame rate limit
@return
- \ref NVML_SUCCESS if \a frameRateLimit has been set
- \ref NVML_ERROR_NOT_SUPPORTED if frame rate limiter is turned off for the vGPU type
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a frameRateLimit is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetFrameRateLimit(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
frameRateLimit: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the current ECC mode of vGPU instance.
@param vgpuInstance The identifier of the target vGPU instance
@param eccMode Reference in which to return the current ECC mode
@return
- \ref NVML_SUCCESS if the vgpuInstance's ECC mode has been successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mode is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetEccMode(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
eccMode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param encoderCapacity Reference to an unsigned int for the encoder capacity
@return
- \ref NVML_SUCCESS if \a encoderCapacity has been retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a encoderQueryType is invalid
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetEncoderCapacity(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
encoderCapacity: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param encoderCapacity Unsigned int for the encoder capacity value
@return
- \ref NVML_SUCCESS if \a encoderCapacity has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a encoderCapacity is out of range of 0-100.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceSetEncoderCapacity(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
encoderCapacity: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the current encoder statistics of a vGPU Instance
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param sessionCount Reference to an unsigned int for count of active encoder sessions
@param averageFps Reference to an unsigned int for trailing average FPS of all active sessions
@param averageLatency Reference to an unsigned int for encode latency in microseconds
@return
- \ref NVML_SUCCESS if \a sessionCount, \a averageFps and \a averageLatency is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount , or \a averageFps or \a averageLatency is NULL
or \a vgpuInstance is 0.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetEncoderStats(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
sessionCount: *mut ::core::ffi::c_uint,
averageFps: *mut ::core::ffi::c_uint,
averageLatency: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves information about all active encoder sessions on a vGPU Instance.
An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The
array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
written to the buffer.
If the supplied buffer is not large enough to accommodate the active session array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount.
To query the number of active encoder sessions, call this function with *sessionCount = 0. The code will return
NVML_SUCCESS with number of active encoder sessions updated in *sessionCount.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param sessionCount Reference to caller supplied array size, and returns
the number of sessions.
@param sessionInfo Reference to caller supplied array in which the list
of session information us returned.
@return
- \ref NVML_SUCCESS if \a sessionInfo is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is
returned in \a sessionCount
- \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL, or \a vgpuInstance is 0.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetEncoderSessions(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
sessionCount: *mut ::core::ffi::c_uint,
sessionInfo: *mut cuda_types::nvml::nvmlEncoderSessionInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the active frame buffer capture sessions statistics of a vGPU Instance
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param fbcStats Reference to nvmlFBCStats_t structure containing NvFBC stats
@return
- \ref NVML_SUCCESS if \a fbcStats is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a fbcStats is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetFBCStats(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
fbcStats: *mut cuda_types::nvml::nvmlFBCStats_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves information about active frame buffer capture sessions on a vGPU Instance.
An array of active FBC sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The
array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions
written to the buffer.
If the supplied buffer is not large enough to accommodate the active session array, the function returns
NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount.
To query the number of active FBC sessions, call this function with *sessionCount = 0. The code will return
NVML_SUCCESS with number of active FBC sessions updated in *sessionCount.
For Maxwell &tm; or newer fully supported devices.
@note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may
be zero if there are no new frames captured since the session started.
@param vgpuInstance Identifier of the target vGPU instance
@param sessionCount Reference to caller supplied array size, and returns the number of sessions.
@param sessionInfo Reference in which to return the session information
@return
- \ref NVML_SUCCESS if \a sessionInfo is fetched
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a sessionCount is NULL.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetFBCSessions(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
sessionCount: *mut ::core::ffi::c_uint,
sessionInfo: *mut cuda_types::nvml::nvmlFBCSessionInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the GPU Instance ID for the given vGPU Instance.
The API will return a valid GPU Instance ID for MIG backed vGPU Instance, else INVALID_GPU_INSTANCE_ID is returned.
For Kepler &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param gpuInstanceId GPU Instance ID
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a gpuInstanceId is NULL.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetGpuInstanceId(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
gpuInstanceId: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the PCI Id of the given vGPU Instance i.e. the PCI Id of the GPU as seen inside the VM.
The vGPU PCI id is returned as "00000000:00:00.0" if NVIDIA driver is not installed on the vGPU instance.
@param vgpuInstance Identifier of the target vGPU instance
@param vgpuPciId Caller-supplied buffer to return vGPU PCI Id string
@param length Size of the vgpuPciId buffer
@return
- \ref NVML_SUCCESS if vGPU PCI Id is sucessfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a vgpuPciId is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small, \a length is set to required length
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetGpuPciId(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
vgpuPciId: *mut ::core::ffi::c_char,
length: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the requested capability for a given vGPU type. Refer to the \a nvmlVgpuCapability_t structure
for the specific capabilities that can be queried. The return value in \a capResult should be treated as
a boolean, with a non-zero value indicating that the capability is supported.
For Maxwell &tm; or newer fully supported devices.
@param vgpuTypeId Handle to vGPU type
@param capability Specifies the \a nvmlVgpuCapability_t to be queried
@param capResult A boolean for the queried capability indicating that feature is supported
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a capability is invalid, or \a capResult is NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuTypeGetCapabilities(
vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t,
capability: cuda_types::nvml::nvmlVgpuCapability_t,
capResult: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieve the MDEV UUID of a vGPU instance.
The MDEV UUID is a globally unique identifier of the mdev device assigned to the VM, and is returned as a 5-part hexadecimal string,
not exceeding 80 characters in length (including the NULL terminator).
MDEV UUID is displayed only on KVM platform.
See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param mdevUuid Pointer to caller-supplied buffer to hold MDEV UUID
@param size Size of buffer in bytes
@return
- \ref NVML_SUCCESS successful completion
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_NOT_SUPPORTED on any hypervisor other than KVM
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mdevUuid is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetMdevUUID(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
mdevUuid: *mut ::core::ffi::c_char,
size: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns vGPU metadata structure for a running vGPU. The structure contains information about the vGPU and its associated VM
such as the currently installed NVIDIA guest driver version, together with host driver version and an opaque data section
containing internal state.
nvmlVgpuInstanceGetMetadata() may be called at any time for a vGPU instance. Some fields in the returned structure are
dependent on information obtained from the guest VM, which may not yet have reached a state where that information
is available. The current state of these dependent fields is reflected in the info structure's \ref nvmlVgpuGuestInfoState_t field.
The VMM may choose to read and save the vGPU's VM info as persistent metadata associated with the VM, and provide
it to Virtual GPU Manager when creating a vGPU for subsequent instances of the VM.
The caller passes in a buffer via \a vgpuMetadata, with the size of the buffer in \a bufferSize. If the vGPU Metadata structure
is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed
in \a bufferSize.
@param vgpuInstance vGPU instance handle
@param vgpuMetadata Pointer to caller-supplied buffer into which vGPU metadata is written
@param bufferSize Size of vgpuMetadata buffer
@return
- \ref NVML_SUCCESS vGPU metadata structure was successfully returned
- \ref NVML_ERROR_INSUFFICIENT_SIZE vgpuMetadata buffer is too small, required size is returned in \a bufferSize
- \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a vgpuInstance is 0; if \a vgpuMetadata is NULL and the value of \a bufferSize is not 0.
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetMetadata(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
vgpuMetadata: *mut cuda_types::nvml::nvmlVgpuMetadata_t,
bufferSize: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns a vGPU metadata structure for the physical GPU indicated by \a device. The structure contains information about
the GPU and the currently installed NVIDIA host driver version that's controlling it, together with an opaque data section
containing internal state.
The caller passes in a buffer via \a pgpuMetadata, with the size of the buffer in \a bufferSize. If the \a pgpuMetadata
structure is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed
in \a bufferSize.
@param device The identifier of the target device
@param pgpuMetadata Pointer to caller-supplied buffer into which \a pgpuMetadata is written
@param bufferSize Pointer to size of \a pgpuMetadata buffer
@return
- \ref NVML_SUCCESS GPU metadata structure was successfully returned
- \ref NVML_ERROR_INSUFFICIENT_SIZE pgpuMetadata buffer is too small, required size is returned in \a bufferSize
- \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a device is invalid; if \a pgpuMetadata is NULL and the value of \a bufferSize is not 0.
- \ref NVML_ERROR_NOT_SUPPORTED vGPU is not supported by the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuMetadata(
device: cuda_types::nvml::nvmlDevice_t,
pgpuMetadata: *mut cuda_types::nvml::nvmlVgpuPgpuMetadata_t,
bufferSize: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Takes a vGPU instance metadata structure read from \ref nvmlVgpuInstanceGetMetadata(), and a vGPU metadata structure for a
physical GPU read from \ref nvmlDeviceGetVgpuMetadata(), and returns compatibility information of the vGPU instance and the
physical GPU.
The caller passes in a buffer via \a compatibilityInfo, into which a compatibility information structure is written. The
structure defines the states in which the vGPU / VM may be booted on the physical GPU. If the vGPU / VM compatibility
with the physical GPU is limited, a limit code indicates the factor limiting compatability.
(see \ref nvmlVgpuPgpuCompatibilityLimitCode_t for details).
Note: vGPU compatibility does not take into account dynamic capacity conditions that may limit a system's ability to
boot a given vGPU or associated VM.
@param vgpuMetadata Pointer to caller-supplied vGPU metadata structure
@param pgpuMetadata Pointer to caller-supplied GPU metadata structure
@param compatibilityInfo Pointer to caller-supplied buffer to hold compatibility info
@return
- \ref NVML_SUCCESS vGPU metadata structure was successfully returned
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuMetadata or \a pgpuMetadata or \a bufferSize are NULL
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlGetVgpuCompatibility(
vgpuMetadata: *mut cuda_types::nvml::nvmlVgpuMetadata_t,
pgpuMetadata: *mut cuda_types::nvml::nvmlVgpuPgpuMetadata_t,
compatibilityInfo: *mut cuda_types::nvml::nvmlVgpuPgpuCompatibility_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the properties of the physical GPU indicated by the device in an ascii-encoded string format.
The caller passes in a buffer via \a pgpuMetadata, with the size of the buffer in \a bufferSize. If the
string is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed
in \a bufferSize.
@param device The identifier of the target device
@param pgpuMetadata Pointer to caller-supplied buffer into which \a pgpuMetadata is written
@param bufferSize Pointer to size of \a pgpuMetadata buffer
@return
- \ref NVML_SUCCESS GPU metadata structure was successfully returned
- \ref NVML_ERROR_INSUFFICIENT_SIZE \a pgpuMetadata buffer is too small, required size is returned in \a bufferSize
- \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a device is invalid; if \a pgpuMetadata is NULL and the value of \a bufferSize is not 0.
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the system
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetPgpuMetadataString(
device: cuda_types::nvml::nvmlDevice_t,
pgpuMetadata: *mut ::core::ffi::c_char,
bufferSize: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the vGPU Software scheduler logs.
\a pSchedulerLog points to a caller-allocated structure to contain the logs. The number of elements returned will
never exceed \a NVML_SCHEDULER_SW_MAX_LOG_ENTRIES.
To get the entire logs, call the function atleast 5 times a second.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target \a device
@param pSchedulerLog Reference in which \a pSchedulerLog is written
@return
- \ref NVML_SUCCESS vGPU scheduler logs were successfully obtained
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pSchedulerLog is NULL or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state or \a device not in vGPU host mode
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuSchedulerLog(
device: cuda_types::nvml::nvmlDevice_t,
pSchedulerLog: *mut cuda_types::nvml::nvmlVgpuSchedulerLog_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the vGPU scheduler state.
The information returned in \a nvmlVgpuSchedulerGetState_t is not relevant if the BEST EFFORT policy is set.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target \a device
@param pSchedulerState Reference in which \a pSchedulerState is returned
@return
- \ref NVML_SUCCESS vGPU scheduler state is successfully obtained
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pSchedulerState is NULL or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state or \a device not in vGPU host mode
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuSchedulerState(
device: cuda_types::nvml::nvmlDevice_t,
pSchedulerState: *mut cuda_types::nvml::nvmlVgpuSchedulerGetState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Returns the vGPU scheduler capabilities.
The list of supported vGPU schedulers returned in \a nvmlVgpuSchedulerCapabilities_t is from
the NVML_VGPU_SCHEDULER_POLICY_*. This list enumerates the supported scheduler policies
if the engine is Graphics type.
The other values in \a nvmlVgpuSchedulerCapabilities_t are also applicable if the engine is
Graphics type. For other engine types, it is BEST EFFORT policy.
If ARR is supported and enabled, scheduling frequency and averaging factor are applicable
else timeSlice is applicable.
For Pascal &tm; or newer fully supported devices.
@param device The identifier of the target \a device
@param pCapabilities Reference in which \a pCapabilities is written
@return
- \ref NVML_SUCCESS vGPU scheduler capabilities were successfully obtained
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pCapabilities is NULL or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state or \a device not in vGPU host mode
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuSchedulerCapabilities(
device: cuda_types::nvml::nvmlDevice_t,
pCapabilities: *mut cuda_types::nvml::nvmlVgpuSchedulerCapabilities_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Sets the vGPU scheduler state.
For Pascal &tm; or newer fully supported devices.
The scheduler state change won't persist across module load/unload.
Scheduler state and params will be allowed to set only when no VM is running.
In \a nvmlVgpuSchedulerSetState_t, IFF enableARRMode is enabled then
provide avgFactorForARR and frequency as input. If enableARRMode is disabled
then provide timeslice as input.
@param device The identifier of the target \a device
@param pSchedulerState vGPU \a pSchedulerState to set
@return
- \ref NVML_SUCCESS vGPU scheduler state has been successfully set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a pSchedulerState is NULL or \a device is invalid
- \ref NVML_ERROR_RESET_REQUIRED if setting \a pSchedulerState failed with fatal error,
reboot is required to overcome from this error.
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state or \a device not in vGPU host mode
or if any vGPU instance currently exists on the \a device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceSetVgpuSchedulerState(
device: cuda_types::nvml::nvmlDevice_t,
pSchedulerState: *mut cuda_types::nvml::nvmlVgpuSchedulerSetState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the ranges of supported vGPU versions.
This function gets the linear range of supported vGPU versions that is preset for the NVIDIA vGPU Manager and the range set by an administrator.
If the preset range has not been overridden by \ref nvmlSetVgpuVersion, both ranges are the same.
The caller passes pointers to the following \ref nvmlVgpuVersion_t structures, into which the NVIDIA vGPU Manager writes the ranges:
1. \a supported structure that represents the preset range of vGPU versions supported by the NVIDIA vGPU Manager.
2. \a current structure that represents the range of supported vGPU versions set by an administrator. By default, this range is the same as the preset range.
@param supported Pointer to the structure in which the preset range of vGPU versions supported by the NVIDIA vGPU Manager is written
@param current Pointer to the structure in which the range of supported vGPU versions set by an administrator is written
@return
- \ref NVML_SUCCESS The vGPU version range structures were successfully obtained.
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported.
- \ref NVML_ERROR_INVALID_ARGUMENT The \a supported parameter or the \a current parameter is NULL.
- \ref NVML_ERROR_UNKNOWN An error occurred while the data was being fetched.*/
fn nvmlGetVgpuVersion(
supported: *mut cuda_types::nvml::nvmlVgpuVersion_t,
current: *mut cuda_types::nvml::nvmlVgpuVersion_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator.
This function configures the NVIDIA vGPU Manager with a range of supported vGPU versions set by an administrator. This range must be a subset of the
preset range that the NVIDIA vGPU Manager supports. The custom range set by an administrator takes precedence over the preset range and is advertised to
the guest VM for negotiating the vGPU version. See \ref nvmlGetVgpuVersion for details of how to query the preset range of versions supported.
This function takes a pointer to vGPU version range structure \ref nvmlVgpuVersion_t as input to override the preset vGPU version range that the NVIDIA vGPU Manager supports.
After host system reboot or driver reload, the range of supported versions reverts to the range that is preset for the NVIDIA vGPU Manager.
@note 1. The range set by the administrator must be a subset of the preset range that the NVIDIA vGPU Manager supports. Otherwise, an error is returned.
2. If the range of supported guest driver versions does not overlap the range set by the administrator, the guest driver fails to load.
3. If the range of supported guest driver versions overlaps the range set by the administrator, the guest driver will load with a negotiated
vGPU version that is the maximum value in the overlapping range.
4. No VMs must be running on the host when this function is called. If a VM is running on the host, the call to this function fails.
@param vgpuVersion Pointer to a caller-supplied range of supported vGPU versions.
@return
- \ref NVML_SUCCESS The preset range of supported vGPU versions was successfully overridden.
- \ref NVML_ERROR_NOT_SUPPORTED The API is not supported.
- \ref NVML_ERROR_IN_USE The range was not overridden because a VM is running on the host.
- \ref NVML_ERROR_INVALID_ARGUMENT The \a vgpuVersion parameter specifies a range that is outside the range supported by the NVIDIA vGPU Manager or if \a vgpuVersion is NULL.*/
fn nvmlSetVgpuVersion(
vgpuVersion: *mut cuda_types::nvml::nvmlVgpuVersion_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves current utilization for vGPUs on a physical GPU (device).
For Kepler &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for vGPU instances running
on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer
pointed at by \a utilizationSamples. One utilization sample structure is returned per vGPU instance, and includes the
CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values
in nvmlValue_t unions. The function sets the caller-supplied \a sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to
indicate the returned value type.
To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
\a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance
count in \a vgpuInstanceSamplesCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate
a buffer of size vgpuInstanceSamplesCount * sizeof(nvmlVgpuInstanceUtilizationSample_t). Invoke the function again with
the allocated buffer passed in \a utilizationSamples, and \a vgpuInstanceSamplesCount set to the number of entries the
buffer is sized for.
On successful return, the function updates \a vgpuInstanceSampleCount with the number of vGPU utilization sample
structures that were actually written. This may differ from a previously read value as vGPU instances are created or
destroyed.
lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
@param device The identifier for the target device
@param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp.
@param sampleValType Pointer to caller-supplied buffer to hold the type of returned sample values
@param vgpuInstanceSamplesCount Pointer to caller-supplied array size, and returns number of vGPU instances
@param utilizationSamples Pointer to caller-supplied buffer in which vGPU utilization samples are returned
@return
- \ref NVML_SUCCESS if utilization samples are successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuInstanceSamplesCount or \a sampleValType is
NULL, or a sample count of 0 is passed with a non-NULL \a utilizationSamples
- \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuInstanceSamplesCount is too small to return samples for all
vGPU instances currently executing on the device
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuUtilization(
device: cuda_types::nvml::nvmlDevice_t,
lastSeenTimeStamp: ::core::ffi::c_ulonglong,
sampleValType: *mut cuda_types::nvml::nvmlValueType_t,
vgpuInstanceSamplesCount: *mut ::core::ffi::c_uint,
utilizationSamples: *mut cuda_types::nvml::nvmlVgpuInstanceUtilizationSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves recent utilization for vGPU instances running on a physical GPU (device).
For Kepler &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for vGPU
instances running on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied
buffer pointed at by \a vgpuUtilInfo->vgpuUtilArray. One utilization sample structure is returned per vGPU instance, and includes the
CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values
in nvmlValue_t unions. The function sets the caller-supplied \a vgpuUtilInfo->sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to
indicate the returned value type.
To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
\a vgpuUtilInfo->vgpuUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance
count in \a vgpuUtilInfo->vgpuInstanceCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate
a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t). Invoke the function again with
the allocated buffer passed in \a vgpuUtilInfo->vgpuUtilArray, and \a vgpuUtilInfo->vgpuInstanceCount set to the number of entries the
buffer is sized for.
On successful return, the function updates \a vgpuUtilInfo->vgpuInstanceCount with the number of vGPU utilization sample
structures that were actually written. This may differ from a previously read value as vGPU instances are created or
destroyed.
\a vgpuUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a vgpuUtilInfo->lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
@param device The identifier for the target device
@param vgpuUtilInfo Pointer to the caller-provided structure of nvmlVgpuInstancesUtilizationInfo_t
@return
- \ref NVML_SUCCESS if utilization samples are successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuUtilInfo is NULL, or \a vgpuUtilInfo->vgpuInstanceCount is 0
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_VERSION_MISMATCH if the version of \a vgpuUtilInfo is invalid
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a vgpuUtilInfo->vgpuUtilArray is NULL, or the buffer size of vgpuUtilInfo->vgpuInstanceCount is too small.
The caller should check the current vGPU instance count from the returned vgpuUtilInfo->vgpuInstanceCount, and call
the function again with a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t)
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuInstancesUtilizationInfo(
device: cuda_types::nvml::nvmlDevice_t,
vgpuUtilInfo: *mut cuda_types::nvml::nvmlVgpuInstancesUtilizationInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves current utilization for processes running on vGPUs on a physical GPU (device).
For Maxwell &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running on
vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the
caller-supplied buffer pointed at by \a utilizationSamples. One utilization sample structure is returned per process running
on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which
the samples were recorded. Individual utilization values are returned as "unsigned int" values.
To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
\a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance
count in \a vgpuProcessSamplesCount. The caller should allocate a buffer of size
vgpuProcessSamplesCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with
the allocated buffer passed in \a utilizationSamples, and \a vgpuProcessSamplesCount set to the number of entries the
buffer is sized for.
On successful return, the function updates \a vgpuSubProcessSampleCount with the number of vGPU sub process utilization sample
structures that were actually written. This may differ from a previously read value depending on the number of processes that are active
in any given sample period.
lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
@param device The identifier for the target device
@param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp.
@param vgpuProcessSamplesCount Pointer to caller-supplied array size, and returns number of processes running on vGPU instances
@param utilizationSamples Pointer to caller-supplied buffer in which vGPU sub process utilization samples are returned
@return
- \ref NVML_SUCCESS if utilization samples are successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuProcessSamplesCount or a sample count of 0 is
passed with a non-NULL \a utilizationSamples
- \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuProcessSamplesCount is too small to return samples for all
vGPU instances currently executing on the device
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuProcessUtilization(
device: cuda_types::nvml::nvmlDevice_t,
lastSeenTimeStamp: ::core::ffi::c_ulonglong,
vgpuProcessSamplesCount: *mut ::core::ffi::c_uint,
utilizationSamples: *mut cuda_types::nvml::nvmlVgpuProcessUtilizationSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves recent utilization for processes running on vGPU instances on a physical GPU (device).
For Maxwell &tm; or newer fully supported devices.
Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for processes running
on vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied
buffer pointed at by \a vgpuProcUtilInfo->vgpuProcUtilArray. One utilization sample structure is returned per process running
on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which
the samples were recorded. Individual utilization values are returned as "unsigned int" values.
To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with
\a vgpuProcUtilInfo->vgpuProcUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current processes' count
running on vGPU instances in \a vgpuProcUtilInfo->vgpuProcessCount. The caller should allocate a buffer of size
vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed
in \a vgpuProcUtilInfo->vgpuProcUtilArray, and \a vgpuProcUtilInfo->vgpuProcessCount set to the number of entries the buffer is sized for.
On successful return, the function updates \a vgpuProcUtilInfo->vgpuProcessCount with the number of vGPU sub process utilization sample
structures that were actually written. This may differ from a previously read value depending on the number of processes that are active
in any given sample period.
vgpuProcUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0
to read utilization based on all the samples maintained by the driver's internal sample buffer. Set vgpuProcUtilInfo->lastSeenTimeStamp
to a timeStamp retrieved from a previous query to read utilization since the previous query.
@param device The identifier for the target device
@param vgpuProcUtilInfo Pointer to the caller-provided structure of nvmlVgpuProcessesUtilizationInfo_t
@return
- \ref NVML_SUCCESS if utilization samples are successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a vgpuProcUtilInfo is null
- \ref NVML_ERROR_VERSION_MISMATCH if the version of \a vgpuProcUtilInfo is invalid
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a vgpuProcUtilInfo->vgpuProcUtilArray is null, or supplied \a vgpuProcUtilInfo->vgpuProcessCount
is too small to return samples for all processes on vGPU instances currently executing on the device.
The caller should check the current processes count from the returned \a vgpuProcUtilInfo->vgpuProcessCount,
and call the function again with a buffer of size
vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t)
- \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_NOT_FOUND if sample entries are not found
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetVgpuProcessesUtilizationInfo(
device: cuda_types::nvml::nvmlDevice_t,
vgpuProcUtilInfo: *mut cuda_types::nvml::nvmlVgpuProcessesUtilizationInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries the state of per process accounting mode on vGPU.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance The identifier of the target vGPU instance
@param mode Reference in which to return the current accounting mode
@return
- \ref NVML_SUCCESS if the mode has been successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mode is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature
- \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetAccountingMode(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
mode: *mut cuda_types::nvml::nvmlEnableState_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes
returned can be in running or terminated state.
For Maxwell &tm; or newer fully supported devices.
To just query the maximum number of processes that can be queried, call this function with *count = 0 and
pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
For more details see \ref nvmlVgpuInstanceGetAccountingStats.
@note In case of PID collision some processes might not be accessible before the circular buffer is full.
@param vgpuInstance The identifier of the target vGPU instance
@param count Reference in which to provide the \a pids array size, and
to return the number of elements ready to be queried
@param pids Reference in which to return list of process ids
@return
- \ref NVML_SUCCESS if pids were successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a count is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled
- \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to expected value)
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see nvmlVgpuInstanceGetAccountingPids*/
fn nvmlVgpuInstanceGetAccountingPids(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
count: *mut ::core::ffi::c_uint,
pids: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Queries process's accounting stats.
For Maxwell &tm; or newer fully supported devices.
Accounting stats capture GPU utilization and other statistics across the lifetime of a process, and
can be queried during life time of the process or after its termination.
The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and
updated to actual running time after its termination.
Accounting stats are kept in a circular buffer, newly created processes overwrite information about old
processes.
See \ref nvmlAccountingStats_t for description of each returned metric.
List of processes that can be queried can be retrieved from \ref nvmlVgpuInstanceGetAccountingPids.
@note Accounting Mode needs to be on. See \ref nvmlVgpuInstanceGetAccountingMode.
@note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be
queried since they don't contribute to GPU utilization.
@note In case of pid collision stats of only the latest process (that terminated last) will be reported
@param vgpuInstance The identifier of the target vGPU instance
@param pid Process Id of the target process to query stats for
@param stats Reference in which to return the process's accounting stats
@return
- \ref NVML_SUCCESS if stats have been successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a stats is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
or \a stats is not found
- \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetAccountingStats(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
pid: ::core::ffi::c_uint,
stats: *mut cuda_types::nvml::nvmlAccountingStats_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Clears accounting information of the vGPU instance that have already terminated.
For Maxwell &tm; or newer fully supported devices.
Requires root/admin permissions.
@note Accounting Mode needs to be on. See \ref nvmlVgpuInstanceGetAccountingMode.
@note Only compute and graphics applications stats are reported and can be cleared since monitoring applications
stats don't contribute to GPU utilization.
@param vgpuInstance The identifier of the target vGPU instance
@return
- \ref NVML_SUCCESS if accounting information has been cleared
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is invalid
- \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceClearAccountingPids(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Query the license information of the vGPU instance.
For Maxwell &tm; or newer fully supported devices.
@param vgpuInstance Identifier of the target vGPU instance
@param licenseInfo Pointer to vGPU license information structure
@return
- \ref NVML_SUCCESS if information is successfully retrieved
- \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a licenseInfo is NULL
- \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system
- \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlVgpuInstanceGetLicenseInfo_v2(
vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t,
licenseInfo: *mut cuda_types::nvml::nvmlVgpuLicenseInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Retrieves the number of excluded GPU devices in the system.
For all products.
@param deviceCount Reference in which to return the number of excluded devices
@return
- \ref NVML_SUCCESS if \a deviceCount has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL*/
fn nvmlGetExcludedDeviceCount(
deviceCount: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Acquire the device information for an excluded GPU device, based on its index.
For all products.
Valid indices are derived from the \a deviceCount returned by
\ref nvmlGetExcludedDeviceCount(). For example, if \a deviceCount is 2 the valid indices
are 0 and 1, corresponding to GPU 0 and GPU 1.
@param index The index of the target GPU, >= 0 and < \a deviceCount
@param info Reference in which to return the device information
@return
- \ref NVML_SUCCESS if \a device has been set
- \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a info is NULL
@see nvmlGetExcludedDeviceCount*/
fn nvmlGetExcludedDeviceInfoByIndex(
index: ::core::ffi::c_uint,
info: *mut cuda_types::nvml::nvmlExcludedDeviceInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set MIG mode for the device.
For Ampere &tm; or newer fully supported devices.
Requires root user.
This mode determines whether a GPU instance can be created.
This API may unbind or reset the device to activate the requested mode. Thus, the attributes associated with the
device, such as minor number, might change. The caller of this API is expected to query such attributes again.
On certain platforms like pass-through virtualization, where reset functionality may not be exposed directly, VM
reboot is required. \a activationStatus would return \ref NVML_ERROR_RESET_REQUIRED for such cases.
\a activationStatus would return the appropriate error code upon unsuccessful activation. For example, if device
unbind fails because the device isn't idle, \ref NVML_ERROR_IN_USE would be returned. The caller of this API
is expected to idle the device and retry setting the \a mode.
@note On Windows, only disabling MIG mode is supported. \a activationStatus would return \ref
NVML_ERROR_NOT_SUPPORTED as GPU reset is not supported on Windows through this API.
@param device The identifier of the target device
@param mode The mode to be set, \ref NVML_DEVICE_MIG_DISABLE or
\ref NVML_DEVICE_MIG_ENABLE
@param activationStatus The activationStatus status
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device,\a mode or \a activationStatus are invalid
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG mode*/
fn nvmlDeviceSetMigMode(
device: cuda_types::nvml::nvmlDevice_t,
mode: ::core::ffi::c_uint,
activationStatus: *mut cuda_types::nvml::nvmlReturn_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get MIG mode for the device.
For Ampere &tm; or newer fully supported devices.
Changing MIG modes may require device unbind or reset. The "pending" MIG mode refers to the target mode following the
next activation trigger.
@param device The identifier of the target device
@param currentMode Returns the current mode, \ref NVML_DEVICE_MIG_DISABLE or
\ref NVML_DEVICE_MIG_ENABLE
@param pendingMode Returns the pending mode, \ref NVML_DEVICE_MIG_DISABLE or
\ref NVML_DEVICE_MIG_ENABLE
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a currentMode or \a pendingMode are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG mode*/
fn nvmlDeviceGetMigMode(
device: cuda_types::nvml::nvmlDevice_t,
currentMode: *mut ::core::ffi::c_uint,
pendingMode: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instance profile information
Information provided by this API is immutable throughout the lifetime of a MIG mode.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@param profile One of the NVML_GPU_INSTANCE_PROFILE_*
@param info Returns detailed profile information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile or \a info are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profile isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlDeviceGetGpuInstanceProfileInfo(
device: cuda_types::nvml::nvmlDevice_t,
profile: ::core::ffi::c_uint,
info: *mut cuda_types::nvml::nvmlGpuInstanceProfileInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Versioned wrapper around \ref nvmlDeviceGetGpuInstanceProfileInfo that accepts a versioned
\ref nvmlGpuInstanceProfileInfo_v2_t or later output structure.
@note The caller must set the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the
appropriate version prior to calling this function. For example:
\code
nvmlGpuInstanceProfileInfo_v2_t profileInfo =
{ .version = nvmlGpuInstanceProfileInfo_v2 };
nvmlReturn_t result = nvmlDeviceGetGpuInstanceProfileInfoV(device,
profile,
&profileInfo);
\endcode
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device The identifier of the target device
@param profile One of the NVML_GPU_INSTANCE_PROFILE_*
@param info Returns detailed profile information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a info, or \a info->version are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profile isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlDeviceGetGpuInstanceProfileInfoV(
device: cuda_types::nvml::nvmlDevice_t,
profile: ::core::ffi::c_uint,
info: *mut cuda_types::nvml::nvmlGpuInstanceProfileInfo_v2_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instance placements.
A placement represents the location of a GPU instance within a device. This API only returns all the possible
placements for the given profile regardless of whether MIG is enabled or not.
A created GPU instance occupies memory slices described by its placement. Creation of new GPU instance will
fail if there is overlap with the already occupied memory slices.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param device The identifier of the target device
@param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param placements Returns placements allowed for the profile. Can be NULL to discover number
of allowed placements for this profile. If non-NULL must be large enough
to accommodate the placements supported by the profile.
@param count Returns number of allowed placemenets for the profile.
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId or \a count are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlDeviceGetGpuInstancePossiblePlacements_v2(
device: cuda_types::nvml::nvmlDevice_t,
profileId: ::core::ffi::c_uint,
placements: *mut cuda_types::nvml::nvmlGpuInstancePlacement_t,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instance profile capacity.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param device The identifier of the target device
@param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param count Returns remaining instance count for the profile ID
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId or \a count are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlDeviceGetGpuInstanceRemainingCapacity(
device: cuda_types::nvml::nvmlDevice_t,
profileId: ::core::ffi::c_uint,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Create GPU instance.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
If the parent device is unbound, reset or the GPU instance is destroyed explicitly, the GPU instance handle would
become invalid. The GPU instance must be recreated to acquire a valid handle.
@param device The identifier of the target device
@param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param gpuInstance Returns the GPU instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a profileId or \a gpuInstance are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested GPU instance could not be created*/
fn nvmlDeviceCreateGpuInstance(
device: cuda_types::nvml::nvmlDevice_t,
profileId: ::core::ffi::c_uint,
gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Create GPU instance with the specified placement.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
If the parent device is unbound, reset or the GPU instance is destroyed explicitly, the GPU instance handle would
become invalid. The GPU instance must be recreated to acquire a valid handle.
@param device The identifier of the target device
@param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param placement The requested placement. See \ref nvmlDeviceGetGpuInstancePossiblePlacements_v2
@param gpuInstance Returns the GPU instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a profileId, \a placement or \a gpuInstance
are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested GPU instance could not be created*/
fn nvmlDeviceCreateGpuInstanceWithPlacement(
device: cuda_types::nvml::nvmlDevice_t,
profileId: ::core::ffi::c_uint,
placement: *const cuda_types::nvml::nvmlGpuInstancePlacement_t,
gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Destroy GPU instance.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param gpuInstance The GPU instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_IN_USE If the GPU instance is in use. This error would be returned if processes
(e.g. CUDA application) or compute instances are active on the
GPU instance.*/
fn nvmlGpuInstanceDestroy(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instances for given profile ID.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param device The identifier of the target device
@param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param gpuInstances Returns pre-exiting GPU instances, the buffer must be large enough to
accommodate the instances supported by the profile.
See \ref nvmlDeviceGetGpuInstanceProfileInfo
@param count The count of returned GPU instances
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId, \a gpuInstances or \a count are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlDeviceGetGpuInstances(
device: cuda_types::nvml::nvmlDevice_t,
profileId: ::core::ffi::c_uint,
gpuInstances: *mut cuda_types::nvml::nvmlGpuInstance_t,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instances for given instance ID.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param device The identifier of the target device
@param id The GPU instance ID
@param gpuInstance Returns GPU instance
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a id or \a gpuInstance are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_NOT_FOUND If the GPU instance is not found.*/
fn nvmlDeviceGetGpuInstanceById(
device: cuda_types::nvml::nvmlDevice_t,
id: ::core::ffi::c_uint,
gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instance information.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param gpuInstance The GPU instance handle
@param info Return GPU instance information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance or \a info are invalid
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetInfo(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
info: *mut cuda_types::nvml::nvmlGpuInstanceInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance profile information.
Information provided by this API is immutable throughout the lifetime of a MIG mode.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param gpuInstance The identifier of the target GPU instance
@param profile One of the NVML_COMPUTE_INSTANCE_PROFILE_*
@param engProfile One of the NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_*
@param info Returns detailed profile information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a engProfile or \a info are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profile isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetComputeInstanceProfileInfo(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profile: ::core::ffi::c_uint,
engProfile: ::core::ffi::c_uint,
info: *mut cuda_types::nvml::nvmlComputeInstanceProfileInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Versioned wrapper around \ref nvmlGpuInstanceGetComputeInstanceProfileInfo that accepts a versioned
\ref nvmlComputeInstanceProfileInfo_v2_t or later output structure.
@note The caller must set the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the
appropriate version prior to calling this function. For example:
\code
nvmlComputeInstanceProfileInfo_v2_t profileInfo =
{ .version = nvmlComputeInstanceProfileInfo_v2 };
nvmlReturn_t result = nvmlGpuInstanceGetComputeInstanceProfileInfoV(gpuInstance,
profile,
engProfile,
&profileInfo);
\endcode
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param gpuInstance The identifier of the target GPU instance
@param profile One of the NVML_COMPUTE_INSTANCE_PROFILE_*
@param engProfile One of the NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_*
@param info Returns detailed profile information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a engProfile, \a info, or \a info->version are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profile isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetComputeInstanceProfileInfoV(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profile: ::core::ffi::c_uint,
engProfile: ::core::ffi::c_uint,
info: *mut cuda_types::nvml::nvmlComputeInstanceProfileInfo_v2_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance profile capacity.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param gpuInstance The identifier of the target GPU instance
@param profileId The compute instance profile ID.
See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param count Returns remaining instance count for the profile ID
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId or \a availableCount are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetComputeInstanceRemainingCapacity(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profileId: ::core::ffi::c_uint,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance placements.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
A placement represents the location of a compute instance within a GPU instance. This API only returns all the possible
placements for the given profile.
A created compute instance occupies compute slices described by its placement. Creation of new compute instance will
fail if there is overlap with the already occupied compute slices.
@param gpuInstance The identifier of the target GPU instance
@param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param placements Returns placements allowed for the profile. Can be NULL to discover number
of allowed placements for this profile. If non-NULL must be large enough
to accommodate the placements supported by the profile.
@param count Returns number of allowed placemenets for the profile.
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId or \a count are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetComputeInstancePossiblePlacements(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profileId: ::core::ffi::c_uint,
placements: *mut cuda_types::nvml::nvmlComputeInstancePlacement_t,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Create compute instance.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
If the parent device is unbound, reset or the parent GPU instance is destroyed or the compute instance is destroyed
explicitly, the compute instance handle would become invalid. The compute instance must be recreated to acquire
a valid handle.
@param gpuInstance The identifier of the target GPU instance
@param profileId The compute instance profile ID.
See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param computeInstance Returns the compute instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a profileId or \a computeInstance
are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested compute instance could not be created*/
fn nvmlGpuInstanceCreateComputeInstance(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profileId: ::core::ffi::c_uint,
computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Create compute instance with the specified placement.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
If the parent device is unbound, reset or the parent GPU instance is destroyed or the compute instance is destroyed
explicitly, the compute instance handle would become invalid. The compute instance must be recreated to acquire
a valid handle.
@param gpuInstance The identifier of the target GPU instance
@param profileId The compute instance profile ID.
See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param placement The requested placement. See \ref nvmlGpuInstanceGetComputeInstancePossiblePlacements
@param computeInstance Returns the compute instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a profileId or \a computeInstance
are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested compute instance could not be created*/
fn nvmlGpuInstanceCreateComputeInstanceWithPlacement(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profileId: ::core::ffi::c_uint,
placement: *const cuda_types::nvml::nvmlComputeInstancePlacement_t,
computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Destroy compute instance.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param computeInstance The compute instance handle
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a computeInstance is invalid
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_IN_USE If the compute instance is in use. This error would be returned if
processes (e.g. CUDA application) are active on the compute instance.*/
fn nvmlComputeInstanceDestroy(
computeInstance: cuda_types::nvml::nvmlComputeInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instances for given profile ID.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param gpuInstance The identifier of the target GPU instance
@param profileId The compute instance profile ID.
See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param computeInstances Returns pre-exiting compute instances, the buffer must be large enough to
accommodate the instances supported by the profile.
See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo
@param count The count of returned compute instances
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId, \a computeInstances or \a count
are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlGpuInstanceGetComputeInstances(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
profileId: ::core::ffi::c_uint,
computeInstances: *mut cuda_types::nvml::nvmlComputeInstance_t,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance for given instance ID.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
Requires privileged user.
@param gpuInstance The identifier of the target GPU instance
@param id The compute instance ID
@param computeInstance Returns compute instance
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a ID or \a computeInstance are invalid
- \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation
- \ref NVML_ERROR_NOT_FOUND If the compute instance is not found.*/
fn nvmlGpuInstanceGetComputeInstanceById(
gpuInstance: cuda_types::nvml::nvmlGpuInstance_t,
id: ::core::ffi::c_uint,
computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance information.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param computeInstance The compute instance handle
@param info Return compute instance information
@return
- \ref NVML_SUCCESS Upon success
- \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT If \a computeInstance or \a info are invalid
- \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/
fn nvmlComputeInstanceGetInfo_v2(
computeInstance: cuda_types::nvml::nvmlComputeInstance_t,
info: *mut cuda_types::nvml::nvmlComputeInstanceInfo_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Test if the given handle refers to a MIG device.
A MIG device handle is an NVML abstraction which maps to a MIG compute instance.
These overloaded references can be used (with some restrictions) interchangeably
with a GPU device handle to execute queries at a per-compute instance granularity.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device NVML handle to test
@param isMigDevice True when handle refers to a MIG device
@return
- \ref NVML_SUCCESS if \a device status was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle or \a isMigDevice reference is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this check is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceIsMigDeviceHandle(
device: cuda_types::nvml::nvmlDevice_t,
isMigDevice: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPU instance ID for the given MIG device handle.
GPU instance IDs are unique per device and remain valid until the GPU instance is destroyed.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device Target MIG device handle
@param id GPU instance ID
@return
- \ref NVML_SUCCESS if instance ID was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a id reference is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetGpuInstanceId(
device: cuda_types::nvml::nvmlDevice_t,
id: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get compute instance ID for the given MIG device handle.
Compute instance IDs are unique per GPU instance and remain valid until the compute instance
is destroyed.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device Target MIG device handle
@param id Compute instance ID
@return
- \ref NVML_SUCCESS if instance ID was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a id reference is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetComputeInstanceId(
device: cuda_types::nvml::nvmlDevice_t,
id: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the maximum number of MIG devices that can exist under a given parent NVML device.
Returns zero if MIG is not supported or enabled.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device Target device handle
@param count Count of MIG devices
@return
- \ref NVML_SUCCESS if \a count was successfully retrieved
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a count reference is invalid
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMaxMigDeviceCount(
device: cuda_types::nvml::nvmlDevice_t,
count: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get MIG device handle for the given index under its parent NVML device.
If the compute instance is destroyed either explicitly or by destroying,
resetting or unbinding the parent GPU instance or the GPU device itself
the MIG device handle would remain invalid and must be requested again
using this API. Handles may be reused and their properties can change in
the process.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param device Reference to the parent GPU device handle
@param index Index of the MIG device
@param migDevice Reference to the MIG device handle
@return
- \ref NVML_SUCCESS if \a migDevice handle was successfully created
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a index or \a migDevice reference is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_NOT_FOUND if no valid MIG device was found at \a index
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetMigDeviceHandleByIndex(
device: cuda_types::nvml::nvmlDevice_t,
index: ::core::ffi::c_uint,
migDevice: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get parent device handle from a MIG device handle.
For Ampere &tm; or newer fully supported devices.
Supported on Linux only.
@param migDevice MIG device handle
@param device Device handle
@return
- \ref NVML_SUCCESS if \a device handle was successfully created
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a migDevice or \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetDeviceHandleFromMigDeviceHandle(
migDevice: cuda_types::nvml::nvmlDevice_t,
device: *mut cuda_types::nvml::nvmlDevice_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Calculate GPM metrics from two samples.
For Hopper &tm; or newer fully supported devices.
@param metricsGet IN/OUT: populated \a nvmlGpmMetricsGet_t struct
@return
- \ref NVML_SUCCESS on success
- Nonzero NVML_ERROR_? enum on error*/
fn nvmlGpmMetricsGet(
metricsGet: *mut cuda_types::nvml::nvmlGpmMetricsGet_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Free an allocated sample buffer that was allocated with \ref nvmlGpmSampleAlloc()
For Hopper &tm; or newer fully supported devices.
@param gpmSample Sample to free
@return
- \ref NVML_SUCCESS on success
- \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided*/
fn nvmlGpmSampleFree(
gpmSample: cuda_types::nvml::nvmlGpmSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Allocate a sample buffer to be used with NVML GPM . You will need to allocate
at least two of these buffers to use with the NVML GPM feature
For Hopper &tm; or newer fully supported devices.
@param gpmSample Where the allocated sample will be stored
@return
- \ref NVML_SUCCESS on success
- \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided
- \ref NVML_ERROR_MEMORY if system memory is insufficient*/
fn nvmlGpmSampleAlloc(
gpmSample: *mut cuda_types::nvml::nvmlGpmSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Read a sample of GPM metrics into the provided \a gpmSample buffer. After
two samples are gathered, you can call nvmlGpmMetricGet on those samples to
retrive metrics
For Hopper &tm; or newer fully supported devices.
@param device Device to get samples for
@param gpmSample Buffer to read samples into
@return
- \ref NVML_SUCCESS on success
- Nonzero NVML_ERROR_? enum on error*/
fn nvmlGpmSampleGet(
device: cuda_types::nvml::nvmlDevice_t,
gpmSample: cuda_types::nvml::nvmlGpmSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Read a sample of GPM metrics into the provided \a gpmSample buffer for a MIG GPU Instance.
After two samples are gathered, you can call nvmlGpmMetricGet on those
samples to retrive metrics
For Hopper &tm; or newer fully supported devices.
@param device Device to get samples for
@param gpuInstanceId MIG GPU Instance ID
@param gpmSample Buffer to read samples into
@return
- \ref NVML_SUCCESS on success
- Nonzero NVML_ERROR_? enum on error*/
fn nvmlGpmMigSampleGet(
device: cuda_types::nvml::nvmlDevice_t,
gpuInstanceId: ::core::ffi::c_uint,
gpmSample: cuda_types::nvml::nvmlGpmSample_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Indicate whether the supplied device supports GPM
@param device NVML device to query for
@param gpmSupport Structure to indicate GPM support \a nvmlGpmSupport_t. Indicates
GPM support per system for the supplied device
@return
- NVML_SUCCESS on success
- Nonzero NVML_ERROR_? enum if there is an error in processing the query*/
fn nvmlGpmQueryDeviceSupport(
device: cuda_types::nvml::nvmlDevice_t,
gpmSupport: *mut cuda_types::nvml::nvmlGpmSupport_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get GPM stream state.
%HOPPER_OR_NEWER%
Supported on Linux, Windows TCC.
@param device The identifier of the target device
@param state Returns GPM stream state
NVML_FEATURE_DISABLED or NVML_FEATURE_ENABLED
@return
- \ref NVML_SUCCESS if \a current GPM stream state were successfully queried
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a state is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlGpmQueryIfStreamingEnabled(
device: cuda_types::nvml::nvmlDevice_t,
state: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set GPM stream state.
%HOPPER_OR_NEWER%
Supported on Linux, Windows TCC.
@param device The identifier of the target device
@param state GPM stream state,
NVML_FEATURE_DISABLED or NVML_FEATURE_ENABLED
@return
- \ref NVML_SUCCESS if \a current GPM stream state is successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/
fn nvmlGpmSetStreamingEnabled(
device: cuda_types::nvml::nvmlDevice_t,
state: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set NvLink Low Power Threshold for device.
%HOPPER_OR_NEWER%
@param device The identifier of the target device
@param info Reference to \a nvmlNvLinkPowerThres_t struct
input parameters
@return
- \ref NVML_SUCCESS if the \a Threshold is successfully set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a Threshold is not within range
- \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
*/
fn nvmlDeviceSetNvLinkDeviceLowPowerThreshold(
device: cuda_types::nvml::nvmlDevice_t,
info: *mut cuda_types::nvml::nvmlNvLinkPowerThres_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set the global nvlink bandwith mode
@param nvlinkBwMode nvlink bandwidth mode
@return
- \ref NVML_SUCCESS on success
- \ref NVML_ERROR_INVALID_ARGUMENT if an invalid argument is provided
- \ref NVML_ERROR_IN_USE if P2P object exists
- \ref NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture.
- \ref NVML_ERROR_NO_PERMISSION if not root user*/
fn nvmlSystemSetNvlinkBwMode(
nvlinkBwMode: ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get the global nvlink bandwith mode
@param nvlinkBwMode reference of nvlink bandwidth mode
@return
- \ref NVML_SUCCESS on success
- \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided
- \ref NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture.
- \ref NVML_ERROR_NO_PERMISSION if not root user*/
fn nvmlSystemGetNvlinkBwMode(
nvlinkBwMode: *mut ::core::ffi::c_uint,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Set new power limit of this device.
For Kepler &tm; or newer fully supported devices.
Requires root/admin permissions.
See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values.
See \ref nvmlPowerValue_v2_t for more information on the struct.
\note Limit is not persistent across reboots or driver unloads.
Enable persistent mode to prevent driver from unloading when no application is using the device.
This API replaces nvmlDeviceSetPowerManagementLimit. It can be used as a drop-in replacement for the older version.
@param device The identifier of the target device
@param powerValue Power management limit in milliwatts to set
@return
- \ref NVML_SUCCESS if \a limit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a powerValue is NULL or contains invalid values
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_UNKNOWN on any unexpected error
@see NVML_FI_DEV_POWER_AVERAGE
@see NVML_FI_DEV_POWER_INSTANT
@see NVML_FI_DEV_POWER_MIN_LIMIT
@see NVML_FI_DEV_POWER_MAX_LIMIT
@see NVML_FI_DEV_POWER_CURRENT_LIMIT*/
fn nvmlDeviceSetPowerManagementLimit_v2(
device: cuda_types::nvml::nvmlDevice_t,
powerValue: *mut cuda_types::nvml::nvmlPowerValue_v2_t,
) -> cuda_types::nvml::nvmlReturn_t;
#[must_use]
/** Get SRAM ECC error status of this device.
For Ampere &tm; or newer fully supported devices.
Requires root/admin permissions.
See \ref nvmlEccSramErrorStatus_v1_t for more information on the struct.
@param device The identifier of the target device
@param status Returns SRAM ECC error status
@return
- \ref NVML_SUCCESS if \a limit has been set
- \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counters is NULL
- \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
- \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- \ref NVML_ERROR_VERSION_MISMATCH if the version of \a nvmlEccSramErrorStatus_t is invalid
- \ref NVML_ERROR_UNKNOWN on any unexpected error*/
fn nvmlDeviceGetSramEccErrorStatus(
device: cuda_types::nvml::nvmlDevice_t,
status: *mut cuda_types::nvml::nvmlEccSramErrorStatus_t,
) -> cuda_types::nvml::nvmlReturn_t;
}
|