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

Strange 50% CPU usage on nVidia #468

oomek opened this Issue Aug 12, 2018 · 1 comment


None yet
2 participants
Copy link

oomek commented Aug 12, 2018

// Impact of nVidia GPU on CPU performance
// Run in Fullscreen mode

local flw = fe.layout.width
local flh = fe.layout.height

local bar1 = fe.add_image("white.png", 0, 0, 32, flh / 2)
local bar2 = fe.add_image("white.png", 0, flh / 2, 32, flh / 2)

function tick( ttime )
    // this line is using:
    // 1% of CPU with Threaded Optimization OFF in the nVidia control panel
    // 1% - 25% of CPU with Threaded Optimization ON
    bar1.x = ceil( ttime / 16.666667 % flw )
    // this line is using:
    // 25% of CPU on with Threaded Optimization OFF
    // 50% of CPU on with Threaded Optimization ON
    if ( bar2.x > flw ) bar2.x = 0

fe.add_ticks_callback( "tick" )

This comment has been minimized.

Copy link
Collaborator Author

oomek commented Aug 14, 2018

I've narrowed this down to 2 flags in the 3D settings on nvidia equipped PCs

OGL_THREAD_CONTROL_STRING defined as Threaded Optimizations in nv control panel
It's default value is AUTO and for AM it's set to ON.
When you set this to OFF you get 25% less CPU usage

OGL_FORCE_BLIT_STRING defined only in nvidia inspector, but not present in nv control panel
It's default value is OFF. When it's ON you get an additional 25% reduction in CPU usage

What I'm thinking is we could create a profile when AM starts and define those flags on nvidia equipped PCs. When we do this it's also good to enable OGL_TRIPLE_BUFFER_STRING to ON
I've observed it's beneficial for the reduction of stuttering on image loading, until we find a definite way of asynchronous image loading. I'm still thinking about it and I found out that the initial problems with threads behaving irrationally were caused bu those 2 flags I mentioned set to default values. I have now more control over the OGL commands queuing.

@mickelson mickelson added the bug label Sep 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.