Orbmu2k/nvidiaProfileInspector · error · NvapiException
NVAPI_PROFILE_NOT_FOUND
NVAPI_PROFILE_NOT_FOUND
Error message
DRS_GetCurrentGlobalProfile
What it means
Sentinel guard in GetProfileHandle: after DRS_GetCurrentGlobalProfile returns NVAPI_OK, the resulting hProfile is checked for IntPtr.Zero and a manually constructed NvapiException named "DRS_GetCurrentGlobalProfile" is thrown. This is a generic guard, not a driver-reported status: the driver claimed success but returned no global profile handle, typically when no NVIDIA driver or global driver profile is available. The input at fault is the empty/null profileName path that requests the current global profile.
Solutions
- Ensure the NVIDIA driver is installed and functioning before requesting the global profile.
- Catch NvapiException in callers and treat it as "no driver profile available" rather than a hard failure.
- Provide a named profile instead of empty string so the predefined global profile path is not required.
- Retry after driver initialization, e.g. when the app starts before the driver service is ready.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nvidiaProfileInspector/Common/DrsSettingsServiceBase.cs:66 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Orbmu2k/nvidiaProfileInspector@2f50c388b3 (2026-09-15).
Data as JSON: /api/errors/3d774c9ffcd1dc9c.
Report an issue: GitHub.
Appendix: source
Thrown at nvidiaProfileInspector/Common/DrsSettingsServiceBase.cs:66
return true;
}, forceNonGlobalSession: forceNonGlobalSession, preventLoadSettings: preventLoadSettings);
}
protected T DrsSession<T>(Func<IntPtr, T> action, bool forceDedicatedScope = false)
{
return DrsSessionScope.DrsSession<T>(action, forceDedicatedScope);
}
protected IntPtr GetProfileHandle(IntPtr hSession, string profileName)
{
var hProfile = IntPtr.Zero;
if (string.IsNullOrEmpty(profileName))
{
var nvRes = nvw.Instance.DRS_GetCurrentGlobalProfile(hSession, ref hProfile);
if (hProfile == IntPtr.Zero)
throw new NvapiException("DRS_GetCurrentGlobalProfile", NvAPI_Status.NVAPI_PROFILE_NOT_FOUND);
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_GetCurrentGlobalProfile", nvRes);
}
else
{
var nvRes = nvw.Instance.DRS_FindProfileByName(hSession, new StringBuilder(profileName), ref hProfile);
if (nvRes == NvAPI_Status.NVAPI_PROFILE_NOT_FOUND)
return IntPtr.Zero;
if (nvRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_FindProfileByName", nvRes);
}
return hProfile;
}
protected IntPtr CreateProfile(IntPtr hSession, string profileName)View on GitHub (pinned to 2f50c388b3)