[openMSX] Nvidia video high cpu - 'threaded optimization'

Page 1/2
| 2

By ren

Paladin (901)

ren's picture

01-08-2017, 00:42

I recently had to replace my old Radeon video card, and decided to join the green team this time 'round.

Had some issues, some things related to security software I have running (memory access by the video driver I figure), another thing was high CPU usage in openMSX (around 50% on dual core system).

Just figured out that I had to turn 'Threaded optimization' off (for openmsx.exe) in Nividia Control Panel.
Maybe an useful tip for others. Might be worthwhile to check for yourself anyway if you have an Nvidia card, even if you don't experience issues, could perhaps save you quite some CPU cycles.. Wink

Login or register to post comments

By Manuel

Ascended (13559)

Manuel's picture

01-08-2017, 08:02

And are you running with the SDL or the SDLGL-PP renderer?

By ren

Paladin (901)

ren's picture

01-08-2017, 11:51

Some findings with SDLGL-PP, 3x simple, idling in basic, 'threaded optimization' set to auto (default):

Action                   cpu % boosted MSX2+ JP      cpu % plain NMS 8250

fresh start of openMSX   ~50%                        17-~22%
switch to SDL            0-~50% (quite irregular)    12-~15%
switch back to -PP       46-~60% (even higher)       13-~26

And wow, when I turn off desktop composition (which used to give me a little boost) via net stop uxsms, it even goes up to 94 - 99% for the first case (and doing ~13-~17% when switching to SDL).
Even setting threaded optimization to off doesn't help here: 50% cpu. (Might well be with the new card I should just leave it on for best performance though..)

Note that the Nvidia Control Panel itself states: This setting should be turned off for most older applications.

ps. Just found out that Kdenlive also profits from setting the setting to off (wish I realized a couple of videos ago.. ;-))

By Manuel

Ascended (13559)

Manuel's picture

01-08-2017, 12:46

That's pretty bad: 50% on a dual core system means that one core is fully occupied. And it's really weird it's apparently related to the machine you're emulating. If in both cases you're simply looking at an idling MSX-BASIC, that shouldn't matter at all (well, were both using the same screen mode? Please check!).

On my 2008 quad core PC with nVidia GeForce 9600 GT card, I only get about 6% CPU with SDLGL-PP (4x, simple) and Boosted MSX2 EN in BASIC. That's on Linux, though, and these numbers are from my head, as I'm not at home at the moment.

By ren

Paladin (901)

ren's picture

01-08-2017, 14:12

Hmm.. turns out the driver's Vsync setting has to do with this all, and that explains the diff. between the JP and EU machine (running a monitor @60Hz).. Will post more later.

By Louthrax

Paragon (1746)

Louthrax's picture

01-08-2017, 14:47

Maybe something like active VSync wait on the PC (CPU keeps looping waiting for sync)... If both MSX and PC are at 60Hz -> usually no wait, if there's a difference, that can be quite different.

By ren

Paladin (901)

ren's picture

01-08-2017, 18:24

To make clear: I do get (somewhat) low CPU (4%) (boosted MSX2+ JP) when I set 'threaded optimization' to off.
Though when I tried the boosted MSX2 EN I saw relatively high cpu again (22% at 4x).

So it turned out something else is at play: Vsync. This was set to the default of Use the 3D application setting. I was under the assumption openMSX doesn't use any Vsync handling, or am I wrong here? So I figured this default setting should, in this case, translate to off, but it turns out that when I set the driver's Vsync setting to off or adaptive, the aforementioned 22% cpu also goes down. When off I get idling between 0 - 2%, estimated average of < 1% (so that's good ;-) while the adaptive setting requires some more cycles (1-5%).

Now, when I keep Vsync off, and set threaded optimization back to the default of auto, there's only a slight increase of CPU usage: 0 - 6% (stays mostly around 2%) Same for both JP & EN machines.

So conclusion: main culprit seems to be the VSync setting, while threaded optimization also plays a role. But it's unclear to me why the Vsync (default) setting has such a huge effect (on openMSX).

By ren

Paladin (901)

ren's picture

01-08-2017, 20:08

Another thing I noticed, and I'm not sure if that was already there: the Aleste logo jingle ends with a small FM noise (when played for the first time), like part of a hat or something.
This happens on Boosted MSX2+ JP, FS-A1WSX and FS-A1GT (the JP machines I tested), not on (tested) European machines, and CBIOS MSX2+ JP.

When I reset the MSX it plays correctly though.

Relatively a minor issue, perhaps to do with FM initialization?

Buffer size (samples), sound_driver, or resampler type doesn't make a difference.

By Manuel

Ascended (13559)

Manuel's picture

01-08-2017, 20:18

Did you verify on a real MSX?

By ren

Paladin (901)

ren's picture

01-08-2017, 21:48

Unless stated otherwise: I currently don't use / have access to real MSX hardware, and can't test/verify myself (unfortunately). So if someone could verify either on real h/w (though one would know by memory already I suppose ;-)) or on their openMSX setup, would be great.
Tested the WSX on blueMSX: no glitch there.

By Manuel

Ascended (13559)

Manuel's picture

01-08-2017, 23:57

I'm not 100% sure what you actually mean... Can you make a video of it and indicate with the time index when it should be heard?

Page 1/2
| 2
My MSX profile