nvapi_sys/
status.rs

1use std::{fmt, error};
2
3nvenum! {
4    /// NvAPI Status Values
5    ///
6    /// All NvAPI functions return one of these codes.
7    pub enum NvAPI_Status / Status {
8        /// Success. Request is completed.
9        NVAPI_OK / Ok = 0,
10        /// Generic error
11        NVAPI_ERROR / Error = -1,
12        /// NVAPI support library cannot be loaded.
13        NVAPI_LIBRARY_NOT_FOUND / LibraryNotFound = -2,
14        /// not implemented in current driver installation
15        NVAPI_NO_IMPLEMENTATION / NoImplementation = -3,
16        /// NvAPI_Initialize has not been called (successfully)
17        NVAPI_API_NOT_INITIALIZED / ApiNotInitialized = -4,
18        /// The argument/parameter value is not valid or NULL.
19        NVAPI_INVALID_ARGUMENT / InvalidArgument = -5,
20        /// No NVIDIA display driver, or NVIDIA GPU driving a display, was found.
21        NVAPI_NVIDIA_DEVICE_NOT_FOUND / NvidiaDeviceNotFound = -6,
22        /// No more items to enumerate
23        NVAPI_END_ENUMERATION / EndEnumeration = -7,
24        /// Invalid handle
25        NVAPI_INVALID_HANDLE / InvalidHandle = -8,
26        /// An argument's structure version is not supported
27        NVAPI_INCOMPATIBLE_STRUCT_VERSION / IncompatibleStructVersion = -9,
28        /// The handle is no longer valid (likely due to GPU or display re-configuration)
29        NVAPI_HANDLE_INVALIDATED / HandleInvalidated = -10,
30        /// No NVIDIA OpenGL context is current (but needs to be)
31        NVAPI_OPENGL_CONTEXT_NOT_CURRENT / OpenglContextNotCurrent = -11,
32        /// An invalid pointer, usually NULL, was passed as a parameter
33        NVAPI_INVALID_POINTER / InvalidPointer = -14,
34        /// OpenGL Expert is not supported by the current drivers
35        NVAPI_NO_GL_EXPERT / NoGlExpert = -12,
36        /// OpenGL Expert is supported, but driver instrumentation is currently disabled
37        NVAPI_INSTRUMENTATION_DISABLED / InstrumentationDisabled = -13,
38        /// OpenGL does not support Nsight
39        NVAPI_NO_GL_NSIGHT / NoGlNsight = -15,
40
41        /// Expected a logical GPU handle for one or more parameters
42        NVAPI_EXPECTED_LOGICAL_GPU_HANDLE / ExpectedLogicalGpuHandle = -100,
43        /// Expected a physical GPU handle for one or more parameters
44        NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE / ExpectedPhysicalGpuHandle = -101,
45        /// Expected an NV display handle for one or more parameters
46        NVAPI_EXPECTED_DISPLAY_HANDLE / ExpectedDisplayHandle = -102,
47        /// The combination of parameters is not valid. 
48        NVAPI_INVALID_COMBINATION / InvalidCombination = -103,
49        /// Requested feature is not supported in the selected GPU
50        NVAPI_NOT_SUPPORTED / NotSupported = -104,
51        /// No port ID was found for the I2C transaction
52        NVAPI_PORTID_NOT_FOUND / PortidNotFound = -105,
53        /// Expected an unattached display handle as one of the input parameters.
54        NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE / ExpectedUnattachedDisplayHandle = -106,
55        /// Invalid perf level 
56        NVAPI_INVALID_PERF_LEVEL / InvalidPerfLevel = -107,
57        /// Device is busy; request not fulfilled
58        NVAPI_DEVICE_BUSY / DeviceBusy = -108,
59        /// NV persist file is not found
60        NVAPI_NV_PERSIST_FILE_NOT_FOUND / NvPersistFileNotFound = -109,
61        /// NV persist data is not found
62        NVAPI_PERSIST_DATA_NOT_FOUND / PersistDataNotFound = -110,
63        /// Expected a TV output display
64        NVAPI_EXPECTED_TV_DISPLAY / ExpectedTvDisplay = -111,
65        /// Expected a TV output on the D Connector - HDTV_EIAJ4120.
66        NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR / ExpectedTvDisplayOnDconnector = -112,
67        /// SLI is not active on this device.
68        NVAPI_NO_ACTIVE_SLI_TOPOLOGY / NoActiveSliTopology = -113,
69        /// Setup of SLI rendering mode is not possible right now.
70        NVAPI_SLI_RENDERING_MODE_NOTALLOWED / SliRenderingModeNotallowed = -114,
71        /// Expected a digital flat panel.
72        NVAPI_EXPECTED_DIGITAL_FLAT_PANEL / ExpectedDigitalFlatPanel = -115,
73        /// Argument exceeds the expected size.
74        NVAPI_ARGUMENT_EXCEED_MAX_SIZE / ArgumentExceedMaxSize = -116,
75        /// Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active.
76        NVAPI_DEVICE_SWITCHING_NOT_ALLOWED / DeviceSwitchingNotAllowed = -117,
77        /// Testing of clocks is not supported.
78        NVAPI_TESTING_CLOCKS_NOT_SUPPORTED / TestingClocksNotSupported = -118,
79        /// The specified underscan config is from an unknown source (e.g. INF)
80        NVAPI_UNKNOWN_UNDERSCAN_CONFIG / UnknownUnderscanConfig = -119,
81        /// Timeout while reconfiguring GPUs
82        NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO / TimeoutReconfiguringGpuTopo = -120,
83        /// Requested data was not found
84        NVAPI_DATA_NOT_FOUND / DataNotFound = -121,
85        /// Expected an analog display
86        NVAPI_EXPECTED_ANALOG_DISPLAY / ExpectedAnalogDisplay = -122,
87        /// No SLI video bridge is present
88        NVAPI_NO_VIDLINK / NoVidlink = -123,
89        /// NVAPI requires a reboot for the settings to take effect
90        NVAPI_REQUIRES_REBOOT / RequiresReboot = -124,
91        /// The function is not supported with the current Hybrid mode.
92        NVAPI_INVALID_HYBRID_MODE / InvalidHybridMode = -125,
93        /// The target types are not all the same
94        NVAPI_MIXED_TARGET_TYPES / MixedTargetTypes = -126,
95        /// The function is not supported from 32-bit on a 64-bit system.
96        NVAPI_SYSWOW64_NOT_SUPPORTED / Syswow64NotSupported = -127,
97        /// There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology.
98        NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED / ImplicitSetGpuTopologyChangeNotAllowed = -128,
99        /// Prompt the user to close all non-migratable applications. 
100        NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS / RequestUserToCloseNonMigratableApps = -129,
101        /// Could not allocate sufficient memory to complete the call.
102        NVAPI_OUT_OF_MEMORY / OutOfMemory = -130,
103        /// The previous operation that is transferring information to or from this surface is incomplete.
104        NVAPI_WAS_STILL_DRAWING / WasStillDrawing = -131,
105        /// The file was not found.
106        NVAPI_FILE_NOT_FOUND / FileNotFound = -132,
107        /// There are too many unique instances of a particular type of state object.
108        NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS / TooManyUniqueStateObjects = -133,
109        /// The method call is invalid. For example, a method's parameter may not be a valid pointer.
110        NVAPI_INVALID_CALL / InvalidCall = -134,
111        /// d3d10_1.dll cannot be loaded.
112        NVAPI_D3D10_1_LIBRARY_NOT_FOUND / D3d101LibraryNotFound = -135,
113        /// Couldn't find the function in the loaded DLL.
114        NVAPI_FUNCTION_NOT_FOUND / FunctionNotFound = -136,
115        /// Current User is not Admin.
116        NVAPI_INVALID_USER_PRIVILEGE / InvalidUserPrivilege = -137,
117        /// The handle corresponds to GDIPrimary.
118        NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE / ExpectedNonPrimaryDisplayHandle = -138,
119        /// Setting Physx GPU requires that the GPU is compute-capable.
120        NVAPI_EXPECTED_COMPUTE_GPU_HANDLE / ExpectedComputeGpuHandle = -139,
121        /// The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed.
122        NVAPI_STEREO_NOT_INITIALIZED / StereoNotInitialized = -140,
123        /// Access to stereo-related registry keys or values has failed.
124        NVAPI_STEREO_REGISTRY_ACCESS_FAILED / StereoRegistryAccessFailed = -141,
125        /// The given registry profile type is not supported.
126        NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED / StereoRegistryProfileTypeNotSupported = -142,
127        /// The given registry value is not supported.
128        NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED / StereoRegistryValueNotSupported = -143,
129        /// Stereo is not enabled and the function needed it to execute completely.
130        NVAPI_STEREO_NOT_ENABLED / StereoNotEnabled = -144,
131        /// Stereo is not turned on and the function needed it to execute completely.
132        NVAPI_STEREO_NOT_TURNED_ON / StereoNotTurnedOn = -145,
133        /// Invalid device interface.
134        NVAPI_STEREO_INVALID_DEVICE_INTERFACE / StereoInvalidDeviceInterface = -146,
135        /// Separation percentage or JPEG image capture quality is out of [0-100] range.
136        NVAPI_STEREO_PARAMETER_OUT_OF_RANGE / StereoParameterOutOfRange = -147,
137        /// The given frustum adjust mode is not supported.
138        NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED / StereoFrustumAdjustModeNotSupported = -148,
139        /// The mosaic topology is not possible given the current state of the hardware.
140        NVAPI_TOPO_NOT_POSSIBLE / TopoNotPossible = -149,
141        /// An attempt to do a display resolution mode change has failed. 
142        NVAPI_MODE_CHANGE_FAILED / ModeChangeFailed = -150,
143        /// d3d11.dll/d3d11_beta.dll cannot be loaded.
144        NVAPI_D3D11_LIBRARY_NOT_FOUND / D3d11LibraryNotFound = -151,
145        /// Address is outside of valid range.
146        NVAPI_INVALID_ADDRESS / InvalidAddress = -152,
147        /// The pre-allocated string is too small to hold the result.
148        NVAPI_STRING_TOO_SMALL / StringTooSmall = -153,
149        /// The input does not match any of the available devices.
150        NVAPI_MATCHING_DEVICE_NOT_FOUND / MatchingDeviceNotFound = -154,
151        /// Driver is running.
152        NVAPI_DRIVER_RUNNING / DriverRunning = -155,
153        /// Driver is not running.
154        NVAPI_DRIVER_NOTRUNNING / DriverNotrunning = -156,
155        /// A driver reload is required to apply these settings.
156        NVAPI_ERROR_DRIVER_RELOAD_REQUIRED / ErrorDriverReloadRequired = -157,
157        /// Intended setting is not allowed.
158        NVAPI_SET_NOT_ALLOWED / SetNotAllowed = -158,
159        /// Information can't be returned due to "advanced display topology".
160        NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED / AdvancedDisplayTopologyRequired = -159,
161        /// Setting is not found.
162        NVAPI_SETTING_NOT_FOUND / SettingNotFound = -160,
163        /// Setting size is too large.
164        NVAPI_SETTING_SIZE_TOO_LARGE / SettingSizeTooLarge = -161,
165        /// There are too many settings for a profile. 
166        NVAPI_TOO_MANY_SETTINGS_IN_PROFILE / TooManySettingsInProfile = -162,
167        /// Profile is not found.
168        NVAPI_PROFILE_NOT_FOUND / ProfileNotFound = -163,
169        /// Profile name is duplicated.
170        NVAPI_PROFILE_NAME_IN_USE / ProfileNameInUse = -164,
171        /// Profile name is empty.
172        NVAPI_PROFILE_NAME_EMPTY / ProfileNameEmpty = -165,
173        /// Application not found in the Profile.
174        NVAPI_EXECUTABLE_NOT_FOUND / ExecutableNotFound = -166,
175        /// Application already exists in the other profile.
176        NVAPI_EXECUTABLE_ALREADY_IN_USE / ExecutableAlreadyInUse = -167,
177        /// Data Type mismatch 
178        NVAPI_DATATYPE_MISMATCH / DatatypeMismatch = -168,
179        /// The profile passed as parameter has been removed and is no longer valid.
180        NVAPI_PROFILE_REMOVED / ProfileRemoved = -169,
181        /// An unregistered resource was passed as a parameter. 
182        NVAPI_UNREGISTERED_RESOURCE / UnregisteredResource = -170,
183        /// The DisplayId corresponds to a display which is not within the normal outputId range.
184        NVAPI_ID_OUT_OF_RANGE / IdOutOfRange = -171,
185        /// Display topology is not valid so the driver cannot do a mode set on this configuration.
186        NVAPI_DISPLAYCONFIG_VALIDATION_FAILED / DisplayconfigValidationFailed = -172,
187        /// Display Port Multi-Stream topology has been changed.
188        NVAPI_DPMST_CHANGED / DpmstChanged = -173,
189        /// Input buffer is insufficient to hold the contents. 
190        NVAPI_INSUFFICIENT_BUFFER / InsufficientBuffer = -174,
191        /// No access to the caller.
192        NVAPI_ACCESS_DENIED / AccessDenied = -175,
193        /// The requested action cannot be performed without Mosaic being enabled.
194        NVAPI_MOSAIC_NOT_ACTIVE / MosaicNotActive = -176,
195        /// The surface is relocated away from video memory.
196        NVAPI_SHARE_RESOURCE_RELOCATED / ShareResourceRelocated = -177,
197        /// The user should disable DWM before calling NvAPI.
198        NVAPI_REQUEST_USER_TO_DISABLE_DWM / RequestUserToDisableDwm = -178,
199        /// D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device.
200        NVAPI_D3D_DEVICE_LOST / D3dDeviceLost = -179,
201        /// The requested action cannot be performed in the current state.
202        NVAPI_INVALID_CONFIGURATION / InvalidConfiguration = -180,
203        /// Call failed as stereo handshake not completed.
204        NVAPI_STEREO_HANDSHAKE_NOT_DONE / StereoHandshakeNotDone = -181,
205        /// The path provided was too short to determine the correct NVDRS_APPLICATION
206        NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS / ExecutablePathIsAmbiguous = -182,
207        /// Default stereo profile is not currently defined
208        NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED / DefaultStereoProfileIsNotDefined = -183,
209        /// Default stereo profile does not exist
210        NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST / DefaultStereoProfileDoesNotExist = -184,
211        /// A cluster is already defined with the given configuration.
212        NVAPI_CLUSTER_ALREADY_EXISTS / ClusterAlreadyExists = -185,
213        /// The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology 
214        NVAPI_DPMST_DISPLAY_ID_EXPECTED / DpmstDisplayIdExpected = -186,
215        /// The input display id is not valid or the monitor associated to it does not support the current operation
216        NVAPI_INVALID_DISPLAY_ID / InvalidDisplayId = -187,
217        /// While playing secure audio stream, stream goes out of sync
218        NVAPI_STREAM_IS_OUT_OF_SYNC / StreamIsOutOfSync = -188,
219        /// Older audio driver version than required
220        NVAPI_INCOMPATIBLE_AUDIO_DRIVER / IncompatibleAudioDriver = -189,
221        /// Value already set, setting again not allowed.
222        NVAPI_VALUE_ALREADY_SET / ValueAlreadySet = -190,
223        /// Requested operation timed out 
224        NVAPI_TIMEOUT / Timeout = -191,
225        /// The requested workstation feature set has incomplete driver internal allocation resources
226        NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE / GpuWorkstationFeatureIncomplete = -192,
227        /// Call failed because InitActivation was not called.
228        NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE / StereoInitActivationNotDone = -193,
229        /// The requested action cannot be performed without Sync being enabled. 
230        NVAPI_SYNC_NOT_ACTIVE / SyncNotActive = -194,
231        /// The requested action cannot be performed without Sync Master being enabled.
232        NVAPI_SYNC_MASTER_NOT_FOUND / SyncMasterNotFound = -195,
233        /// Invalid displays passed in the NV_GSYNC_DISPLAY pointer.
234        NVAPI_INVALID_SYNC_TOPOLOGY / InvalidSyncTopology = -196,
235        /// The specified signing algorithm is not supported.
236        /// Either an incorrect value was entered or the current installed driver/hardware does not support the input value.
237        NVAPI_ECID_SIGN_ALGO_UNSUPPORTED / EcidSignAlgoUnsupported = -197,
238        /// The encrypted public key verification has failed.
239        NVAPI_ECID_KEY_VERIFICATION_FAILED / EcidKeyVerificationFailed = -198,
240        /// The device's firmware is out of date.
241        NVAPI_FIRMWARE_OUT_OF_DATE / FirmwareOutOfDate = -199,
242        /// The device's firmware is not supported.
243        NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED / FirmwareRevisionNotSupported = -200,
244        /// The caller is not authorized to modify the License.
245        NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED / LicenseCallerAuthenticationFailed = -201,
246        /// The user tried to use a deferred context without registering the device first 	 
247        NVAPI_D3D_DEVICE_NOT_REGISTERED / D3dDeviceNotRegistered = -202,
248        /// Head or SourceId was not reserved for the VR Display before doing the Modeset.
249        NVAPI_RESOURCE_NOT_ACQUIRED / ResourceNotAcquired = -203,
250        /// Provided timing is not supported.
251        NVAPI_TIMING_NOT_SUPPORTED / TimingNotSupported = -204,
252        /// HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable.
253        NVAPI_HDCP_ENCRYPTION_FAILED / HdcpEncryptionFailed = -205,
254        /// Provided mode is over sink device pclk limitation.
255        NVAPI_PCLK_LIMITATION_FAILED / PclkLimitationFailed = -206,
256        /// No connector on GPU found. 
257        NVAPI_NO_CONNECTOR_FOUND / NoConnectorFound = -207,
258        /// When a non-HDCP capable HMD is connected, we would inform user by this code.
259        NVAPI_HDCP_DISABLED / HdcpDisabled = -208,
260        /// Atleast an API is still being called
261        NVAPI_API_IN_USE / ApiInUse = -209,
262        /// No display found on Nvidia GPU(s).
263        NVAPI_NVIDIA_DISPLAY_NOT_FOUND / NvidiaDisplayNotFound = -210,
264        /// Priv security violation, improper access to a secured register.
265        NVAPI_PRIV_SEC_VIOLATION / PrivSecViolation = -211,
266        /// NVAPI cannot be called by this vendor
267        NVAPI_INCORRECT_VENDOR / IncorrectVendor = -212,
268        /// DirectMode Display is already in use
269        NVAPI_DISPLAY_IN_USE / DisplayInUse = -213,
270        /// The Config is having Non-NVidia GPU with Non-HDCP HMD connected
271        NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD / UnsupportedConfigNonHdcpHmd = -214,
272        /// GPU's Max Display Limit has Reached
273        NVAPI_MAX_DISPLAY_LIMIT_REACHED / MaxDisplayLimitReached = -215,
274        /// DirectMode not Enabled on the Display
275        NVAPI_INVALID_DIRECT_MODE_DISPLAY / InvalidDirectModeDisplay = -216,
276        /// GPU is in debug mode, OC is NOT allowed.
277        NVAPI_GPU_IN_DEBUG_MODE / GpuInDebugMode = -217,
278    }
279}
280
281impl error::Error for Status {
282    fn description(&self) -> &str {
283        "NVAPI Error"
284    }
285}
286
287impl fmt::Display for Status {
288    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
289        fmt::Debug::fmt(self, f)
290    }
291}