Jump to content



Photo
* * * * * 1 votes

PinAffinity - new tool for CPU affinity setting


  • Please log in to reply
53 replies to this topic

#21 manples

manples

    Hobbyist

  • Members
  • PipPip
  • 20 posts
  • Location:Texas, USA

  • Flag: France

  • Favorite Pinball: TOTAN

Posted 03 April 2018 - 07:03 PM

Hi mjr,

 

When I launch it manually PinAffinity64 works well on my pincab, but I can't have an auto-start.

 

I've tried both methods in vain:

 

- Shortcut (even manually created it in AppData etc.), with the .exe set to run as admin (all users have admin rights)

- Scheduled task with the highest privilege and /minimize 

 

 

My cab isn't connected and I don't have any login password. It boots and after 5 seconds on the Windows desktop, PinballX automatically lanches.

 

So, to set up a scheduled task I had to set up a password before, then did the task and saved it, then canceled the password at login.

 

Do you think it's privilege related? Any other user reported you that behavior?


my wip


#22 Thalamus

Thalamus

    VPF Veteran

  • Platinum Supporter
  • 5,019 posts

  • Flag: Norway

  • Favorite Pinball: GOT, Alien Star, LOTR, TOM

Posted 03 April 2018 - 07:32 PM

You can't just put a shortcut into the startup menu ? I use it from time to time but, I don't start things automatic so I don't know myself.


From now on. I won't help anyone here at VPF. Please ask Noah why that is.


#23 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 03 April 2018 - 07:37 PM

Hi mjr,

 

When I launch it manually PinAffinity64 works well on my pincab, but I can't have an auto-start.

 

I've tried both methods in vain:

 

- Shortcut (even manually created it in AppData etc.), with the .exe set to run as admin (all users have admin rights)

 

 

Yeah, that approach is impossible due to Windows security rules.  Windows prohibits auto-launching an exe that's marked with Admin privileges, because that would let malware bypass the UAE dialog.  

 

If you want to launch with Admin privileges at startup, the only way is to use Task Scheduler.  I know you said you tried that...

 

- Scheduled task with the highest privilege and /minimize 

 

...but that might also be failing because of the Admin privilege setting you added to the exe.  Try removing the Admin setting on the exe itself and see if that helps.  You of course still need the "highest privileges" setting in the Task Scheduler entry.

 

If that still doesn't work, it's got to be something privilege-related.  Do you just have the one user account on this machine, and it's set up as an Administrator account in the Users control panel?



#24 manples

manples

    Hobbyist

  • Members
  • PipPip
  • 20 posts
  • Location:Texas, USA

  • Flag: France

  • Favorite Pinball: TOTAN

Posted 04 April 2018 - 05:58 PM

Thanks mjr,

 

I've tried to remove the admin setting on the exe itself but still, no auto-start. I just have one user account and it's admin.

 

I must have played too much with the settings, registry base and services tweaking to make this machine as light as possible, it's probably messing up with PinAffinity now ;-)


my wip


#25 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 04 April 2018 - 06:42 PM

I've tried to remove the admin setting on the exe itself but still, no auto-start. I just have one user account and it's admin.

I must have played too much with the settings, registry base and services tweaking to make this machine as light as possible, it's probably messing up with PinAffinity now ;-)

 

Have you tried looking at the task status list section in Task Scheduler?  That should be right in the middle of the main Task Scheduler window, and should show any attempts to launch the program (and the results).

 

And you've probably already checked this, but could it just be hiding in the system tray?  It minimizes to a system tray icon, so you won't see it in the task bar.


Edited by mjr, 04 April 2018 - 07:23 PM.


#26 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 942 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 04 April 2018 - 09:17 PM

Hi MJR,

 

I don't know if you're aware ... but I snuck in affinity settings into VPinmame, so you can define what processor VPInmame runs on, vs. VPinballX.    Set registry entry "cpu_affinity_mask".

 

At one point I had corresponding code for VPX as well, so you could have VPM and VPX on separate distinct cores, but I since lost the latter half of the equation.   This was back when I was running Windows 8 and having severe performance issues when running under pinballx.    It wouldn't be hard to copy and paste this code back out of VPM and into VPX, though, if some wanted more knobs to turn. 

 

As for FPS improvements, Bambi Platfuss did some benchmarking with various CPUs and graphics cards.   The most interesting/surprising statistic was that faster CPUs accounted for a flat ~10fps increase.    On a slow card it might go from 60 to 70, on a fast card, 240 to 250.    So for folks that are barely pulling off 60fps, doing little things like this to improve CPU throughput might actually have very significant results. 

 

As for UAC woes, you can try changing EnableLUA = 0 in registry.   This puts the system back to the good old days of running as a real admin.  On Windows 8/10 it will not run Metro UI apps any longer, so install Chrome first if you need to browse this way.   I run this way on my cab and it works great.   I am not all that concerned about security on it, since it's always running known good applications, and I have a backup if anything happens. 


Edited by DJRobX, 04 April 2018 - 09:23 PM.


#27 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 04 April 2018 - 09:39 PM

I don't know if you're aware ... but I snuck in affinity settings into VPinmame, so you can define what processor VPInmame runs on, vs. VPinballX.    Set registry entry "cpu_affinity_mask".

 

At one point I had corresponding code for VPX as well, so you could have VPM and VPX on separate distinct cores, but I since lost the latter half of the equation.   This was back when I was running Windows 8 and having severe performance issues when running under pinballx.    It wouldn't be hard to copy and paste this code back out of VPM and into VPX, though, if some wanted more knobs to turn. 

 

Good to know.  It would probably be worthwhile to have it in VPX as well.  In principle, that really shouldn't be necessary, because the Windows thread scheduler should notice all by itself that the VP and VPM main threads are sucking up a lot of CPU time and migrate them to separate cores.  But of course theory and practice don't always agree on Windows, so it's always good to at least have the ability to assert manual control.

 

But that said, the main point of the external affinity program isn't really to control which cores VP and VPM are using, so much as to control the cores that everything else in the system is using.  The real point is to confine all of the Windows background tasks to a group of cores that are more or less guaranteed not to interrupt VP and VPM threads, because those momentary interruptions that can cause stutter even when you have a perfectly good nominal average frame rate.  The human eye can see those very short pauses that aren't long enough or common enough to affect the averages.

 

 

As for UAC woes, you can try changing EnableLUA = 0 in registry.   This puts the system back to the good old days of running as a real admin.  On Windows 8/10 it will not run Metro UI apps any longer, so install Chrome first if you need to browse this way.   I run this way on my cab and it works great.   I am not all that concerned about security on it, since it's always running known good applications, and I have a backup if anything happens. 

 

That makes me awfully queasy.  I mean, yeah, if you only use the machine for pin cab purposes and keep away from random Internet usage, then its baseline risk isn't too bad, plus you hopefully don't have any personal files that you care about getting corrupted or stolen.  But there are other risks besides losing files; e.g., if you have the machine connected to your LAN, it could serve as a malware portal to your network. 

 

The flip side of your "it works great with UAC disabled" is my "it works great with UAC enabled".  It is possible to configure everything without resorting to this particular nuclear option.



#28 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 942 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 04 April 2018 - 09:54 PM

Yep, I just find UAC to be a far, far more trouble than it's worth for my pincab.   Just wanted to throw it out as an option to the user who's currently struggling to get things to work.  Modern malware is designed with the assumption that UAC is in place anyway. 

With VP and frontends and all of the other little helper applications like PBXRecorder, it seems people are constantly struggling with admin vs. non-admin settings, unblocking DLLs, etc.    My desktop that I use to browse the internet is a completely different story.  



#29 malifica

malifica

    Hobbyist

  • Platinum Supporter
  • 22 posts
  • Location:Texas

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 19 April 2018 - 02:39 PM

Longtime listener, first time caller... When I see all these CPU affinity discussions it seems to always be about segregating a process (not thread) to a single core, but this causes more harm than anything else. For instance, vpinballx.exe will run 5 to 8 threads just by sitting at the editor with nothing to do, and a CORE can execute a single thread at a time (more on that later). Now once you load a table and decide to play it, vpinballx.exe starts up itself as the "player" which is a duplicate process and now we have even more threads running. If the table happens to use VPinmame, then this is a THIRD process all running under the vpinballx.exe "umbrella." As a simple test I ran a modern Stern table and ended up with about 30 concurrent threads running.

 

CPU affinity (and IO, Memory, Priority) in this case is inherited by the launching process, the original vpinballx.exe, so whatever you have that exe set to will also set the same parameters to the player and the vpinmame processes.

 

So the deal about a core only able to run a single thread at a time... this is true, BUT... a core can run MULTIPLE threads concurrently through the magic of cpu "time slices" and out of order executions, etc. This is where the Windows scheduler comes in and likely knows how to run the myriad threads happening on your system (remember that vpinballx.exe isn't the only thing currently running) better than you do by forcing a process (not a thread) to sit all alone with only a single core to work with.

 

Okay... so when does cpu affinity make sense to manually adjust? When a program does not handle the built in latency of HT (having a core literally run 2 threads concurrently) being utilized by the system. In this case, you want to set your program to run in "Single Threaded Performance Mode," which just means to use ALL actual cpu cores and to ignore the virtual cores provided by hyper threading. If you have an Intel i7 with 4 real and 8 total "cores" (like the 3770 for instance)  you would set the Affinity to 0,2,4,6 so the program only uses the real cores thereby removing itself from the possible bottleneck/latency that HT executions may cause. But really, there are much better ways to make sure your pinball plays the best it can.

 

Set Priority Class to HIGH

Set IO Priority to HIGH

Set Memory Priority to 5 (or NORMAL)

If you have an HT enabled CPU Set Affinity to use ALL and ONLY the actual cores.

 

For the Video Card (in your card software)

 

Set Vsync to ON (you are not conducting a video card FPS benchmark)

Set Pre-Rendered frames to 1 (lowers input lag)

Set Triple Buffering to ON (really lowers input lag)

DO NOT USE AN HDMI CABLE(s) IF YOU HAVE A 120/144hz monitor(s)

 

For your input device

 

Use a USB 3 input jack

If using a keyboard, make sure you have a "gaming" one that lets you manually set polling rate (1ms is nice) and can disable "key delay."

If using a controller like an Xbox or Playstation game pad, make sure it is a WIRELESS unit as it polls much faster (1000hz vs 125hz) than a wired unit.

 

If you have used the above settings and still have stuttering and/or frame delay or input lag. You need a NEW computer system (there is much more going on than just a CPU or Video Card upgrade to influence overall system performance) and for a Windows 10 system you really should have at least:

 

CPU - i7 7700k (all video pinball, 2d fighters and shmups like high clock rates and single threaded performance because many of the graphics routines are still handled by the CPU and keep in mind you need to be using Vsync)

Hard Drive - SSD for the OS

Video Card - At minimum an Nvidia 960, but a 970, or better yet the 1060 6GB is a good choice if you have no interest in VR.

 

Well this went on for longer than I had intended... and before I forget, try Process Lasso (I use the Free version myself) if you want to easily set the various parameters discussed here.

 

And thanks to everyone for all the hours and expertise you all bring to and hand over to this hobby, I have had years of enjoyment due to all of you and have also gained some interesting real-world applicable programming pointers from fiddling with the various tables to get them to my liking.

 

Cheers!


Edited by malifica, 19 April 2018 - 03:02 PM.


#30 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 19 April 2018 - 05:51 PM

For instance, vpinballx.exe will run 5 to 8 threads just by sitting at the editor with nothing to do, and a CORE can execute a single thread at a time (more on that later). Now once you load a table and decide to play it, vpinballx.exe starts up itself as the "player" which is a duplicate process and now we have even more threads running. If the table happens to use VPinmame, then this is a THIRD process all running under the vpinballx.exe "umbrella." 

 

I'm afraid you're a bit off about the VP process architecture here.  You can get out a tool like Process Explorer if you want to look for yourself, but the quick summary is that the VP editor and player run as a single process (there's no separate subprocess launch for the player), and PinMAME runs as a COM in-process server, meaning that it's just COM objects created within the same process.  It *is* possible to run B2S as a separate process, but that also can run as an in-process COM server, and performance tends to be better that way due to the overhead of marshaling COM calls across process boundaries.

 

But that's all kind of beside the point in that this isn't really about the process architecture.  The broader point of core affinity controls would apply either way...

 

 

So the deal about a core only able to run a single thread at a time... this is true, BUT... a core can run MULTIPLE threads concurrently through the magic of cpu "time slices" and out of order executions, etc. This is where the Windows scheduler comes in and likely knows how to run the myriad threads happening on your system (remember that vpinballx.exe isn't the only thing currently running) better than you do by forcing a process (not a thread) to sit all alone with only a single core to work with.

 

I think you might have gotten it upside-down about what PinAffinity is supposed to be used for.  It's not about isolating VP to one core.  Just the opposite.  It's about giving VP (almost) all the cores to itself, and isolating everything *else* to one core, so that the other stuff can't get in VP's way as easily.  The point is basically to give Windows a free hand in optimally scheduling VP's threads without having to figure out what to do with the other processes running in the system.  You want to make it as close as possible to having VP being the only thing running, as far as the thread scheduler is concerned.

 

If you get out a good process profiling tool like Process Explorer, you can monitor the CPU time needs of the individual threads within VP.  That will help illuminate why giving three or so cores to VP is pretty optimal.  You'll see two threads consuming a ton of CPU time individually:  the main VP thread, which is where all of the physics modeling and DX rendering occur, and the VPinMAME thread, where all of the ROM emulation occurs.  Then there are about 30 additional threads (the exact number will vary by system, because a lot of them are worker threads for device drivers and device-related subsystems) that take practically no CPU time.

 

Thanks for your other tips about optimizing.



#31 malifica

malifica

    Hobbyist

  • Platinum Supporter
  • 22 posts
  • Location:Texas

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 19 April 2018 - 09:47 PM

mjr... Thanks for the feedback and the detailed insight. 

 

However, my post was worded in a manner that was layperson friendly, and was the reason why I stated VP "umbrella" process and used air quotes around words. 

 

Also, I think you may have missed the point of my post... which is that unless you have an HT enabled CPU, there is no reason to mess with process CPU affinity when dealing with something like VP (I'm quite familiar with the source code) because when the windows scheduler decides that one of the virtual cores is the thread preferred processor you now have the possibility for overall ordering group latency.



#32 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 20 April 2018 - 12:37 AM

Also, I think you may have missed the point of my post... which is that unless you have an HT enabled CPU, there is no reason to mess with process CPU affinity when dealing with something like VP (I'm quite familiar with the source code) because when the windows scheduler decides that one of the virtual cores is the thread preferred processor you now have the possibility for overall ordering group latency.

 

Again, you're reading it backwards.  It's not about messing with VP's affinities.  It's about messing with everything else's affinities, to give VP more exclusive access to the cores it's using.

 

And I get that you have a theoretical understanding that says this can't work.  The thing that makes that a hard sell is that the experiments say it does work.  When the theory doesn't agree with the experiment, it's a sign that one of them needs some revision, and in this case I'm satisfied with my experiments.  So... :)  But in any case, I hereby release you from compulsory installation. 



#33 malifica

malifica

    Hobbyist

  • Platinum Supporter
  • 22 posts
  • Location:Texas

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 20 April 2018 - 01:26 AM

mjr, You should not be setting process affinity to segregate for any programs (except maybe an AV that is unruly). Theoretical? Well, I have an objective understanding of what works, and what is placebo and what is happenstance and anecdotal, but we don't need to go down that road today.

 

I think (or know  :crazy:) that since you have a 3770 you are seeing performance stability from various affinity settings due to the HT scheduling issue and nothing more. But you should take a look (I assume you use the process tool you suggested) at the threads involved with your input device(s) and video/sound card that are not being displayed to you under the vpinballx.exe process and you may find some interesting scheduler choices (for instance if you haven't completely turned off HT at the BIOS level) you will likely find some necessary for VP to operate threads parked on your virtual cores. Now if you go back to your VP process (and depending on how you have your monitoring set up) you may see VP threads that are dependent on these other process threads (they will usually be scheduled with the highest priority) destroy and restart as these "outside" processes are tardy in their responses.

 

Anyway... I'm (educated) guessing a properly configured 3770 system is utilizing about 15-20% max total CPU for the VP application under full load on a table like Funhouse (or some other geometry heavy table), so how do we improve the performance of an application that can't fully utilize the 4/8 cores you have? Increase the clock speed (I believe you eluded to this in an earlier post)! Not sure if you said you had a k version CPU, but seriously do some tests WITHOUT your affinity settings and OVERCLOCK, then do them again with Affinity set to 0,2,4,6 (I don't know the hex for that off the top of my head) to rid yourself of the HT latency, then do it one last time with your Affinity settings. Notice any difference?

 

I have access to an old 3770 (no k) system that I could do a fresh OS install and use your Affinity setting program and compare results if you are interested.

 

This feels like work... I think I'll just play some pinball.



#34 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 20 April 2018 - 02:22 AM

This feels like work... I think I'll just play some pinball.

 

Indeed; I think we just need to agree to disagree about this!  It works for me, and if the tool is helpful for anyone else, great, but if not that's fine too.  (And for what it's worth, I use an i5 [no hyperthreading] machine for my pin cab, so HT isn't a factor here.) 



#35 bord

bord

    Pinball Fan

  • Members
  • PipPipPipPip
  • 603 posts

  • Flag: ---------

  • Favorite Pinball: Star Gazer, Whirlwind, Frontier

Posted 20 April 2018 - 01:51 PM

Scottacus pointed me toward this project. Very helpful so far. Thanks, mjr!

#36 malifica

malifica

    Hobbyist

  • Platinum Supporter
  • 22 posts
  • Location:Texas

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 20 April 2018 - 02:41 PM

mjr... I did a little more messing around with various "optimization" settings, not just affinity and found that I could anticipate a slight "hiccup" in the simulation due to a delay in resolving DSOUND threads. I then set up a repeatable table test using one of JP's tables that has incidental sounds for every object (super handy for this test) and as suspected, when a direct sound thread would get assigned to processor 0 (the one that seems to get all the heavy lifting OS stuff and also the vpinmame process) and if the stars didn't completely align in the threads favor, you could actually get the occasional slow/dropped game tick.

 

So... there is quantifiable evidence that VP does need to have it's own play area, and along with some additional testing, it seems it is always a good idea to make sure that vpinmame is NOT on CPU 0.

 

The more you learn...

 

By the way, this is with the most recent compiled 10.5 beta running on an 8700k (at 4.7Ghz) with HT disabled (6 cores) and on the latest Windows 10, so it isn't likely I am clock bound.

 

Edit: Saw some interesting behavior here when I moved the VP stuff to run on cores 2 through 6, and after checking directly with Intel, it seems that Coffee Lake (like this 8700k) and newer CPUs do NOT have an across the board turbo clock, so core 0 may get a FULL turbo boost, but the remaining cores will not hit the same peak frequency (normal turbo speeds being 4.7, 4.6, 4.4, 4.2, etc...) which may (should) influence your choice of affinity settings.

 

Edit2: Also, some older CPUs only will boost based on core 0 usage... this may explain some other poster's performance degradation with specific affinity settings.

 

Edit3: And some motherboards will actually SLOW down the complete CPU clock rate when core 0 is being underutilized.


Edited by malifica, 20 April 2018 - 03:20 PM.


#37 ludovids

ludovids

    Enthusiast

  • Validating
  • PipPipPip
  • 181 posts
  • Location:Owego, NY

  • Flag: United States of America

  • Favorite Pinball: LOTR IJ MM TAF Tommy TOTAN TZ

Posted 02 June 2018 - 12:44 PM

Hey mjr, I just came across this and thought you might find it iteresting (maybe you knew about it already):

 

Intel’s Turbo Boost Technology 3.0 was introduced with Broadwell-E. With Turbo Boost Max 3.0 technology, single-thread performance can be improved by identifying the fastest core on a particular processor die and prioritizing critical workloads for that core. With Turbo Boost 3.0, not only does the processor’s frequency ramp up when needed, but workloads are also directed to the fastest possible core available. As it stands today, if you don't have Redstone 1 (a Windows 10 codename), Turbo Boost Max 3.0 technology requires the installation of a driver and secondary utility that launches with Windows. We assume some form of Turbo Boost 3.0 will be implemented on Kaby Lake-based 7th Gen Core processors for desktop systems as well, and ideally, support for that technology would be baked right into the operating system.


ASRock Z270M Extreme4, i5-7600K, 16GB G.SKILL TridentZ DDR4 3200, EVGA GeForce GTX 1070 SC

Samsung 850 EVO M.2, Samsung UN40JU7100 4K playfield, Samsung SynchMaster 2232 backglass, Pinscape on VirtuaPin Plunger Kit v3


#38 Fusionwerks

Fusionwerks

    Poorly recovering pinball addict

  • Platinum Supporter
  • 418 posts

  • Flag: United States of America

  • Favorite Pinball: JP (DE), Deadpool, James Bond 007

Posted 13 November 2018 - 04:54 PM

I FINALLY got around to trying this program out. I wasn't get much stutter anymore since i reloaded everything on my cab, but i though i'd try it anyway. I'm not sure if I've noticed any 

increase or decrease in performance but i did want to point out that if anyone is using pinup player, they might want to add the PinUpPlayer.exe, and PinUpDisplay.exe to the Pinball group. I was getting significant stutter when ever a video would play or the pinup player updated the score, which is very often. This seemed to really only happen on the pinup originals like my table "Clue", and Scott's "Stranger Things".



#39 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 13 November 2018 - 06:50 PM

I FINALLY got around to trying this program out. I wasn't get much stutter anymore since i reloaded everything on my cab, but i though i'd try it anyway. I'm not sure if I've noticed any 

increase or decrease in performance but i did want to point out that if anyone is using pinup player, they might want to add the PinUpPlayer.exe, and PinUpDisplay.exe to the Pinball group. I was getting significant stutter when ever a video would play or the pinup player updated the score, which is very often. This seemed to really only happen on the pinup originals like my table "Clue", and Scott's "Stranger Things".

 

Good point!  The same goes for any front end system you're using, especially if it plays video, since any video player will want to use multiple threads and cores.  And in the case of PuP, I think he's using VLC Player as a subprocess, so you'll probably also want to add VLC Player to the Pinball group.



#40 Brer Frog

Brer Frog

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,095 posts
  • Location:Illinois

  • Flag: United States of America

  • Favorite Pinball: Funhouse, Attack From Mars, Medieval Madness

Posted 09 December 2018 - 11:09 AM

 

I don't know if you're aware ... but I snuck in affinity settings into VPinmame, so you can define what processor VPInmame runs on, vs. VPinballX.    Set registry entry "cpu_affinity_mask".

 

At one point I had corresponding code for VPX as well, so you could have VPM and VPX on separate distinct cores, but I since lost the latter half of the equation.   This was back when I was running Windows 8 and having severe performance issues when running under pinballx.    It wouldn't be hard to copy and paste this code back out of VPM and into VPX, though, if some wanted more knobs to turn. 

 

Good to know.  It would probably be worthwhile to have it in VPX as well.  In principle, that really shouldn't be necessary, because the Windows thread scheduler should notice all by itself that the VP and VPM main threads are sucking up a lot of CPU time and migrate them to separate cores.  But of course theory and practice don't always agree on Windows, so it's always good to at least have the ability to assert manual control.

 

But that said, the main point of the external affinity program isn't really to control which cores VP and VPM are using, so much as to control the cores that everything else in the system is using.  The real point is to confine all of the Windows background tasks to a group of cores that are more or less guaranteed not to interrupt VP and VPM threads, because those momentary interruptions that can cause stutter even when you have a perfectly good nominal average frame rate.  The human eye can see those very short pauses that aren't long enough or common enough to affect the averages.

 

 

As for UAC woes, you can try changing EnableLUA = 0 in registry.   This puts the system back to the good old days of running as a real admin.  On Windows 8/10 it will not run Metro UI apps any longer, so install Chrome first if you need to browse this way.   I run this way on my cab and it works great.   I am not all that concerned about security on it, since it's always running known good applications, and I have a backup if anything happens. 

 

That makes me awfully queasy.  I mean, yeah, if you only use the machine for pin cab purposes and keep away from random Internet usage, then its baseline risk isn't too bad, plus you hopefully don't have any personal files that you care about getting corrupted or stolen.  But there are other risks besides losing files; e.g., if you have the machine connected to your LAN, it could serve as a malware portal to your network. 

 

The flip side of your "it works great with UAC disabled" is my "it works great with UAC enabled".  It is possible to configure everything without resorting to this particular nuclear option.

 

 

I’ve been reading this thread & your PinAffinity instructions & am trying to get an understanding of how affinity works.

You mention that PinAffinity controls “the cores that everything else in the system is using” and “to confine all of the Windows background tasks to a group of cores”. Since there appears to be a lot of Windows background processes running, wouldn’t it be easier to just select the cores that VP & VPM should use? Why not just assign them 3 cores as you indicate is pretty optimal?

The PinAffinity instructions mention “Affinity optimization can reduce stutter by reducing thread scheduling latency”. I have no idea how threads or cores are assigned, but that almost sounds like if fewer cores or threads are used there would be less scheduling latency & therefore less stutter. IOW assigning a single core to Visual Pinball would be ideal. Apparently that does not appear to be optimal.

But what is recommended if I upgrade to an Intel i5-8400 with 6 real cores? If one core is selected for all the Windows background tasks that leaves 5 cores for VP & VPM. Will that cause too much “thread scheduling latency” & therefore too much stutter? Am I better off using only 4 real cores?

Thanks for any clarification.