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
use std::{fmt, error};
nvenum! {
pub enum NvAPI_Status / Status {
NVAPI_OK / Ok = 0,
NVAPI_ERROR / Error = -1,
NVAPI_LIBRARY_NOT_FOUND / LibraryNotFound = -2,
NVAPI_NO_IMPLEMENTATION / NoImplementation = -3,
NVAPI_API_NOT_INITIALIZED / ApiNotInitialized = -4,
NVAPI_INVALID_ARGUMENT / InvalidArgument = -5,
NVAPI_NVIDIA_DEVICE_NOT_FOUND / NvidiaDeviceNotFound = -6,
NVAPI_END_ENUMERATION / EndEnumeration = -7,
NVAPI_INVALID_HANDLE / InvalidHandle = -8,
NVAPI_INCOMPATIBLE_STRUCT_VERSION / IncompatibleStructVersion = -9,
NVAPI_HANDLE_INVALIDATED / HandleInvalidated = -10,
NVAPI_OPENGL_CONTEXT_NOT_CURRENT / OpenglContextNotCurrent = -11,
NVAPI_INVALID_POINTER / InvalidPointer = -14,
NVAPI_NO_GL_EXPERT / NoGlExpert = -12,
NVAPI_INSTRUMENTATION_DISABLED / InstrumentationDisabled = -13,
NVAPI_NO_GL_NSIGHT / NoGlNsight = -15,
NVAPI_EXPECTED_LOGICAL_GPU_HANDLE / ExpectedLogicalGpuHandle = -100,
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE / ExpectedPhysicalGpuHandle = -101,
NVAPI_EXPECTED_DISPLAY_HANDLE / ExpectedDisplayHandle = -102,
NVAPI_INVALID_COMBINATION / InvalidCombination = -103,
NVAPI_NOT_SUPPORTED / NotSupported = -104,
NVAPI_PORTID_NOT_FOUND / PortidNotFound = -105,
NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE / ExpectedUnattachedDisplayHandle = -106,
NVAPI_INVALID_PERF_LEVEL / InvalidPerfLevel = -107,
NVAPI_DEVICE_BUSY / DeviceBusy = -108,
NVAPI_NV_PERSIST_FILE_NOT_FOUND / NvPersistFileNotFound = -109,
NVAPI_PERSIST_DATA_NOT_FOUND / PersistDataNotFound = -110,
NVAPI_EXPECTED_TV_DISPLAY / ExpectedTvDisplay = -111,
NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR / ExpectedTvDisplayOnDconnector = -112,
NVAPI_NO_ACTIVE_SLI_TOPOLOGY / NoActiveSliTopology = -113,
NVAPI_SLI_RENDERING_MODE_NOTALLOWED / SliRenderingModeNotallowed = -114,
NVAPI_EXPECTED_DIGITAL_FLAT_PANEL / ExpectedDigitalFlatPanel = -115,
NVAPI_ARGUMENT_EXCEED_MAX_SIZE / ArgumentExceedMaxSize = -116,
NVAPI_DEVICE_SWITCHING_NOT_ALLOWED / DeviceSwitchingNotAllowed = -117,
NVAPI_TESTING_CLOCKS_NOT_SUPPORTED / TestingClocksNotSupported = -118,
NVAPI_UNKNOWN_UNDERSCAN_CONFIG / UnknownUnderscanConfig = -119,
NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO / TimeoutReconfiguringGpuTopo = -120,
NVAPI_DATA_NOT_FOUND / DataNotFound = -121,
NVAPI_EXPECTED_ANALOG_DISPLAY / ExpectedAnalogDisplay = -122,
NVAPI_NO_VIDLINK / NoVidlink = -123,
NVAPI_REQUIRES_REBOOT / RequiresReboot = -124,
NVAPI_INVALID_HYBRID_MODE / InvalidHybridMode = -125,
NVAPI_MIXED_TARGET_TYPES / MixedTargetTypes = -126,
NVAPI_SYSWOW64_NOT_SUPPORTED / Syswow64NotSupported = -127,
NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED / ImplicitSetGpuTopologyChangeNotAllowed = -128,
NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS / RequestUserToCloseNonMigratableApps = -129,
NVAPI_OUT_OF_MEMORY / OutOfMemory = -130,
NVAPI_WAS_STILL_DRAWING / WasStillDrawing = -131,
NVAPI_FILE_NOT_FOUND / FileNotFound = -132,
NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS / TooManyUniqueStateObjects = -133,
NVAPI_INVALID_CALL / InvalidCall = -134,
NVAPI_D3D10_1_LIBRARY_NOT_FOUND / D3d101LibraryNotFound = -135,
NVAPI_FUNCTION_NOT_FOUND / FunctionNotFound = -136,
NVAPI_INVALID_USER_PRIVILEGE / InvalidUserPrivilege = -137,
NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE / ExpectedNonPrimaryDisplayHandle = -138,
NVAPI_EXPECTED_COMPUTE_GPU_HANDLE / ExpectedComputeGpuHandle = -139,
NVAPI_STEREO_NOT_INITIALIZED / StereoNotInitialized = -140,
NVAPI_STEREO_REGISTRY_ACCESS_FAILED / StereoRegistryAccessFailed = -141,
NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED / StereoRegistryProfileTypeNotSupported = -142,
NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED / StereoRegistryValueNotSupported = -143,
NVAPI_STEREO_NOT_ENABLED / StereoNotEnabled = -144,
NVAPI_STEREO_NOT_TURNED_ON / StereoNotTurnedOn = -145,
NVAPI_STEREO_INVALID_DEVICE_INTERFACE / StereoInvalidDeviceInterface = -146,
NVAPI_STEREO_PARAMETER_OUT_OF_RANGE / StereoParameterOutOfRange = -147,
NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED / StereoFrustumAdjustModeNotSupported = -148,
NVAPI_TOPO_NOT_POSSIBLE / TopoNotPossible = -149,
NVAPI_MODE_CHANGE_FAILED / ModeChangeFailed = -150,
NVAPI_D3D11_LIBRARY_NOT_FOUND / D3d11LibraryNotFound = -151,
NVAPI_INVALID_ADDRESS / InvalidAddress = -152,
NVAPI_STRING_TOO_SMALL / StringTooSmall = -153,
NVAPI_MATCHING_DEVICE_NOT_FOUND / MatchingDeviceNotFound = -154,
NVAPI_DRIVER_RUNNING / DriverRunning = -155,
NVAPI_DRIVER_NOTRUNNING / DriverNotrunning = -156,
NVAPI_ERROR_DRIVER_RELOAD_REQUIRED / ErrorDriverReloadRequired = -157,
NVAPI_SET_NOT_ALLOWED / SetNotAllowed = -158,
NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED / AdvancedDisplayTopologyRequired = -159,
NVAPI_SETTING_NOT_FOUND / SettingNotFound = -160,
NVAPI_SETTING_SIZE_TOO_LARGE / SettingSizeTooLarge = -161,
NVAPI_TOO_MANY_SETTINGS_IN_PROFILE / TooManySettingsInProfile = -162,
NVAPI_PROFILE_NOT_FOUND / ProfileNotFound = -163,
NVAPI_PROFILE_NAME_IN_USE / ProfileNameInUse = -164,
NVAPI_PROFILE_NAME_EMPTY / ProfileNameEmpty = -165,
NVAPI_EXECUTABLE_NOT_FOUND / ExecutableNotFound = -166,
NVAPI_EXECUTABLE_ALREADY_IN_USE / ExecutableAlreadyInUse = -167,
NVAPI_DATATYPE_MISMATCH / DatatypeMismatch = -168,
NVAPI_PROFILE_REMOVED / ProfileRemoved = -169,
NVAPI_UNREGISTERED_RESOURCE / UnregisteredResource = -170,
NVAPI_ID_OUT_OF_RANGE / IdOutOfRange = -171,
NVAPI_DISPLAYCONFIG_VALIDATION_FAILED / DisplayconfigValidationFailed = -172,
NVAPI_DPMST_CHANGED / DpmstChanged = -173,
NVAPI_INSUFFICIENT_BUFFER / InsufficientBuffer = -174,
NVAPI_ACCESS_DENIED / AccessDenied = -175,
NVAPI_MOSAIC_NOT_ACTIVE / MosaicNotActive = -176,
NVAPI_SHARE_RESOURCE_RELOCATED / ShareResourceRelocated = -177,
NVAPI_REQUEST_USER_TO_DISABLE_DWM / RequestUserToDisableDwm = -178,
NVAPI_D3D_DEVICE_LOST / D3dDeviceLost = -179,
NVAPI_INVALID_CONFIGURATION / InvalidConfiguration = -180,
NVAPI_STEREO_HANDSHAKE_NOT_DONE / StereoHandshakeNotDone = -181,
NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS / ExecutablePathIsAmbiguous = -182,
NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED / DefaultStereoProfileIsNotDefined = -183,
NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST / DefaultStereoProfileDoesNotExist = -184,
NVAPI_CLUSTER_ALREADY_EXISTS / ClusterAlreadyExists = -185,
NVAPI_DPMST_DISPLAY_ID_EXPECTED / DpmstDisplayIdExpected = -186,
NVAPI_INVALID_DISPLAY_ID / InvalidDisplayId = -187,
NVAPI_STREAM_IS_OUT_OF_SYNC / StreamIsOutOfSync = -188,
NVAPI_INCOMPATIBLE_AUDIO_DRIVER / IncompatibleAudioDriver = -189,
NVAPI_VALUE_ALREADY_SET / ValueAlreadySet = -190,
NVAPI_TIMEOUT / Timeout = -191,
NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE / GpuWorkstationFeatureIncomplete = -192,
NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE / StereoInitActivationNotDone = -193,
NVAPI_SYNC_NOT_ACTIVE / SyncNotActive = -194,
NVAPI_SYNC_MASTER_NOT_FOUND / SyncMasterNotFound = -195,
NVAPI_INVALID_SYNC_TOPOLOGY / InvalidSyncTopology = -196,
NVAPI_ECID_SIGN_ALGO_UNSUPPORTED / EcidSignAlgoUnsupported = -197,
NVAPI_ECID_KEY_VERIFICATION_FAILED / EcidKeyVerificationFailed = -198,
NVAPI_FIRMWARE_OUT_OF_DATE / FirmwareOutOfDate = -199,
NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED / FirmwareRevisionNotSupported = -200,
NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED / LicenseCallerAuthenticationFailed = -201,
NVAPI_D3D_DEVICE_NOT_REGISTERED / D3dDeviceNotRegistered = -202,
NVAPI_RESOURCE_NOT_ACQUIRED / ResourceNotAcquired = -203,
NVAPI_TIMING_NOT_SUPPORTED / TimingNotSupported = -204,
NVAPI_HDCP_ENCRYPTION_FAILED / HdcpEncryptionFailed = -205,
NVAPI_PCLK_LIMITATION_FAILED / PclkLimitationFailed = -206,
NVAPI_NO_CONNECTOR_FOUND / NoConnectorFound = -207,
NVAPI_HDCP_DISABLED / HdcpDisabled = -208,
NVAPI_API_IN_USE / ApiInUse = -209,
NVAPI_NVIDIA_DISPLAY_NOT_FOUND / NvidiaDisplayNotFound = -210,
NVAPI_PRIV_SEC_VIOLATION / PrivSecViolation = -211,
NVAPI_INCORRECT_VENDOR / IncorrectVendor = -212,
NVAPI_DISPLAY_IN_USE / DisplayInUse = -213,
NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD / UnsupportedConfigNonHdcpHmd = -214,
NVAPI_MAX_DISPLAY_LIMIT_REACHED / MaxDisplayLimitReached = -215,
NVAPI_INVALID_DIRECT_MODE_DISPLAY / InvalidDirectModeDisplay = -216,
NVAPI_GPU_IN_DEBUG_MODE / GpuInDebugMode = -217,
}
}
impl error::Error for Status {
fn description(&self) -> &str {
"NVAPI Error"
}
}
impl fmt::Display for Status {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(self, f)
}
}