summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-02-14 22:49:50 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-03 00:27:04 +0200
commita546aa20b7a5256cb0cfcddff2f09c225c15c794 (patch)
tree04e3475d5f8854821cdf620492a4b945146f83a2 /indra/newview/llappviewerwin32.cpp
parent204072d51cb6c0f742873ccd98da2c761573b587 (diff)
SL-4126 Second Life messing up NVIDIA drivers
Disable NvAPI by default
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp48
1 files changed, 28 insertions, 20 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 0c764fe48a..b36c5a61a3 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -386,27 +386,35 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
LL_WARNS() << "Application init failed." << LL_ENDL;
return -1;
}
-
- NvAPI_Status status;
-
- // Initialize NVAPI
- status = NvAPI_Initialize();
- NvDRSSessionHandle hSession = 0;
- if (status == NVAPI_OK)
- {
- // Create the session handle to access driver settings
- status = NvAPI_DRS_CreateSession(&hSession);
- if (status != NVAPI_OK)
- {
- nvapi_error(status);
- }
- else
- {
- //override driver setting as needed
- ll_nvapi_init(hSession);
- }
- }
+ NvDRSSessionHandle hSession = 0;
+ // Viewer shouldn't need NvAPI and this implementation alters global
+ // settings instead of viewer-only ones (SL-4126)
+ // TODO: ideally this should be removed, but temporary disabling
+ // it with a way to turn it back on in case of issues
+ static LLCachedControl<bool> use_nv_api(gSavedSettings, "NvAPISessionOverride", false);
+ if (use_nv_api)
+ {
+ NvAPI_Status status;
+
+ // Initialize NVAPI
+ status = NvAPI_Initialize();
+
+ if (status == NVAPI_OK)
+ {
+ // Create the session handle to access driver settings
+ status = NvAPI_DRS_CreateSession(&hSession);
+ if (status != NVAPI_OK)
+ {
+ nvapi_error(status);
+ }
+ else
+ {
+ //override driver setting as needed
+ ll_nvapi_init(hSession);
+ }
+ }
+ }
// Have to wait until after logging is initialized to display LFH info
if (num_heaps > 0)