1

I can't get 100% CPU utilization when compiling a large C++ project (many files) using Visual Studio 2015.

When setting the compiler /MP flag, I get low CPU utilization: low utilization

When setting /MP32 I get better results, but still not the desired full utilization: better

I should mention that the current OS is Windows Server 2012 R2, which was originally installed on a VM image. Recently we started using this machine instead the VM, so the disk image was copied here. Perhaps the compiler is getting confused about how many cores are actually installed?

Edit: I noticed that the "NUMBER_OF_PROCESSORS" environment variable was 16, and not the expected 32. I switched the "NUMA Group Size Optimization" BIOS to "Flat", as advised here, and the NUMBER_OF_PROCESSORS variable now shows 32. The utilization is still not full - now I get ~70% when building this project (same result as setting /MP32 manually).

Community
  • 1
  • 1
liorda
  • 1,552
  • 2
  • 15
  • 38
  • 2
    Each core (16) has 2 hyper-threads which are not truly independent from each other... you may well have the cores fully loaded with the 2nd logical processor on each core unable to be fully utilized because of resource contention... – mark Feb 14 '17 at 14:34
  • @mark resource contention? like what? BTW These graphs were taken while compiling a single large project. When compiling multiple (other) projects in parallel I easily get to >90% utilization. – liorda Feb 14 '17 at 14:37
  • 2
    Logical processors share resources like the execution engine, caches, system bus etc. I can't say for sure processor resource contention is your issue, but it's suspicious considering you have exactly half fully utilized, and half nearly-equally partially utilized... – mark Feb 14 '17 at 14:48
  • Have you disable the /Gm option, which enables minimal rebuild, under Code Generation? – Leo Liu Feb 15 '17 at 06:11
  • @Leo-MSFT the minimal rebuild option is disabled – liorda Feb 15 '17 at 07:47

0 Answers0