Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRAM Budget adjustments #3378

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Conversation

akleshchev
Copy link
Contributor

@akleshchev akleshchev commented Jan 9, 2025

  1. Instead of reducing bias when not over budget, start resducing it only once there is 10% free memory to use, to avoid memory immediately going over budget
  2. Intel UHD on a 8gb PC was using 3.5Gb of shared vram which is way too generous given viewer's ram needs. For intels caped vram budget reported by DX9 to 25% ram.

@akleshchev akleshchev force-pushed the andreyk/viewer_3360 branch from 876d94b to dc456ae Compare January 9, 2025 16:14
@@ -4681,6 +4682,23 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem()

// Alternatively use GetDesc from below to get adapter's memory
UINT64 budget_mb = info.Budget / (1024 * 1024);
if (gGLManager.mIsIntel)
Copy link
Contributor

@Ansariel Ansariel Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More a general question: What about Intel's discrete GPU cards? Isn't there a more general distinction required?

Copy link
Contributor Author

@akleshchev akleshchev Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect those would have accurate gGLManager.mVRAM already, but without having a physical one, hard to be sure. worst case 25% is still a reasonable limit.

Potentially we can substract desc.SharedSystemMemory to get real memory in case of descrete GPU (more than a Gb real=>descrete), but I'm not comfortable doing that without having hardware to test it. Otherwise not sure how to detect those without hardcoding GPU names.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or mIsIntel should only be true for integrated GPUs - if there is a way to detect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the purpose of mIsIntel. AMD has built in GPUs and those need same treatment just in case OS/bios is overeager with shared memory. The problem is detection.

@Ansariel
Copy link
Contributor

Ansariel commented Jan 9, 2025

What about slowing down bias decrease? Currently it is evaluating and decreasing bias every frame AFAIK.

@akleshchev
Copy link
Contributor Author

akleshchev commented Jan 10, 2025

What about slowing down bias decrease?

That is indeed too fast and changes multiple times before memory usage has a chance to change. I will check it, but might leave it for later.

@Ansariel
Copy link
Contributor

What about slowing down bias decrease?

That is indeed too fast and changes multiple times before memory usage has a chance to change. I will check it, but might leave it for later.

You can probably pull the check for the evaluation timer outside of if (is_low) and reset it each time the timer ran out.

@akleshchev
Copy link
Contributor Author

You can probably pull the check for the evaluation timer outside of if (is_low) and reset it each time the timer ran out.

I think it should be constrained not by timer, but framerate. Higher framerate -> more textures get processed, the faster bias should adjust. Timer isn't the right solution here.

FREE_PERCENTAGE_TRESHOLD in decrement should already halve reduced decrease rate compared to ExtraFPS. For now I will keep things as is, will let QA test it, but will keep an eye on bias in heavy regions.

@akleshchev akleshchev merged commit eb48eea into release/2024.12-ForeverFPS Jan 10, 2025
11 checks passed
@akleshchev akleshchev deleted the andreyk/viewer_3360 branch January 10, 2025 22:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Texture pipeline in ExtraFPS has wrong texture bias calculation, causing unnecessary texture scaling.
3 participants