From f145d0dbe1d1f28c3e874b77b965e6e07066f39a Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Fri, 21 Jan 2022 16:18:54 -0600 Subject: SL-16447 Adjust default graphics preferences based on modern memory bandwidth levels and bias settings based on CPU speed. --- indra/newview/llfeaturemanager.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 3240f169b3..c3780e42c6 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -402,6 +402,7 @@ bool LLFeatureManager::loadGPUClass() { if (!gSavedSettings.getBOOL("SkipBenchmark")) { + F32 class0_gbps = gSavedSettings.getF32("RenderClass0MemoryBandwidth"); //get memory bandwidth from benchmark F32 gbps; try @@ -418,6 +419,12 @@ bool LLFeatureManager::loadGPUClass() LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL; } + // bias by CPU speed + F32 cpu_basis_mhz = gSavedSettings.getF32("RenderCPUBasis"); + F32 cpu_mhz = (F32) gSysCPU.getMHz(); + F32 cpu_bias = llclamp(cpu_mhz / cpu_basis_mhz, 0.5f, 1.f); + gbps *= cpu_bias; + if (gbps < 0.f) { //couldn't bench, use GLVersion #if LL_DARWIN @@ -460,23 +467,23 @@ bool LLFeatureManager::loadGPUClass() { mGPUClass = GPU_CLASS_1; } - else if (gbps <= 5.f) + else if (gbps <= class0_gbps) { mGPUClass = GPU_CLASS_0; } - else if (gbps <= 8.f) + else if (gbps <= class0_gbps*2.f) { mGPUClass = GPU_CLASS_1; } - else if (gbps <= 16.f) + else if (gbps <= class0_gbps*4.f) { mGPUClass = GPU_CLASS_2; } - else if (gbps <= 40.f) + else if (gbps <= class0_gbps*8.f) { mGPUClass = GPU_CLASS_3; } - else if (gbps <= 80.f) + else if (gbps <= class0_gbps*16.f) { mGPUClass = GPU_CLASS_4; } -- cgit v1.3 From 9c7ec66d248369ebfb589a9c84cf951f8d4b93b5 Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Mon, 24 Jan 2022 11:04:11 -0600 Subject: SL-16691 Add GPU memory bandwidth to ViewerStats --- indra/newview/llfeaturemanager.cpp | 2 ++ indra/newview/llfeaturemanager.h | 5 +++++ indra/newview/llviewerstats.cpp | 1 + 3 files changed, 8 insertions(+) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index c3780e42c6..0813057714 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -419,6 +419,8 @@ bool LLFeatureManager::loadGPUClass() LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL; } + mGPUMemoryBandwidth = gbps; + // bias by CPU speed F32 cpu_basis_mhz = gSavedSettings.getF32("RenderCPUBasis"); F32 cpu_mhz = (F32) gSysCPU.getMHz(); diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 42a226cd18..651404d890 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -111,6 +111,10 @@ public: EGPUClass getGPUClass() { return mGPUClass; } std::string& getGPUString() { return mGPUString; } + + // get the measured GPU memory bandwidth in GB/sec + // may return 0 of benchmark has not been run or failed to run + F32 getGPUMemoryBandwidth() { return mGPUMemoryBandwidth; } BOOL isGPUSupported() { return mGPUSupported; } F32 getExpectedGLVersion() { return mExpectedGLVersion; } @@ -162,6 +166,7 @@ protected: S32 mTableVersion; BOOL mSafe; // Reinitialize everything to the "safe" mask EGPUClass mGPUClass; + F32 mGPUMemoryBandwidth = 0.f; // measured memory bandwidth of GPU in GB/second F32 mExpectedGLVersion; //expected GL version according to gpu table std::string mGPUString; BOOL mGPUSupported; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 5ce97c086d..a560778ef4 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -512,6 +512,7 @@ void send_viewer_stats(bool include_preferences) system["gpu"] = gpu_desc; system["gpu_class"] = (S32)LLFeatureManager::getInstance()->getGPUClass(); + system["gpu_memory_bandwidth"] = LLFeatureManager::getInstance()->getGPUMemoryBandwidth(); system["gpu_vendor"] = gGLManager.mGLVendorShort; system["gpu_version"] = gGLManager.mDriverVersionVendorString; system["opengl_version"] = gGLManager.mGLVersionString; -- cgit v1.3 From d611734c04857f1365220b9446a2e50a89080e0c Mon Sep 17 00:00:00 2001 From: akleshchev <117672381+akleshchev@users.noreply.github.com> Date: Sat, 4 Mar 2023 02:29:48 +0200 Subject: SL-15752 Reduce default graphical quality on machines with little memory (#105) --- indra/newview/llfeaturemanager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llfeaturemanager.cpp') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e934041e2e..042db597c4 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -490,6 +490,18 @@ bool LLFeatureManager::loadGPUClass() { mGPUClass = GPU_CLASS_5; } + + #if LL_WINDOWS + const F32Gigabytes MIN_PHYSICAL_MEMORY(2); + + LLMemory::updateMemoryInfo(); + F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); + if (MIN_PHYSICAL_MEMORY > physical_mem && mGPUClass > GPU_CLASS_1) + { + // reduce quality on systems that don't have enough memory + mGPUClass = (EGPUClass)(mGPUClass - 1); + } + #endif //LL_WINDOWS } //end if benchmark else { -- cgit v1.3