2

I'm attempting to utilize all 12 cores of our build server, but am unable to specify /M12 and get all 12 cores working on the build. It appears as though /M4 is the limit. Is this true? Is there anything I can do to use all 12 cores in our builds?

I'm using the following command line to run the build:

"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe" /M12 C:\Projects\solution1.sln

The build treats it as if I specified one core based on how long the build takes to run and the initial output I receive is:

1) Build started: Project: Project1, Configuration: Release

If I use /M4 in the command line instead of /M12, the build goes much faster, and I receive this as the starting output:

5) Build started: Project: Project5, Configuration: Release
1) Build started: Project: Project1, Configuration: Release
2) Build started: Project: Project2, Configuration: Release
7) Build started: Project: Project7, Configuration: Release

I've tried not specifying the number of cores as well, but it treats it as if the machine has only one core or as if I had specified /M1.

I checked the system environment variable NUMBER_OF_PROCESSORS and it is still set to 12.

Any help with this would be appreciated.

-Seth

Seth S
  • 21
  • 1

1 Answers1

0

It might depend on your particular project configuration that VCBuild cannot parallelize more than four projects for your particular build configuration.

For example, my understanding (feel free to correct):

  1. VCBuild cannot parallelize within a project
  2. VCBuild cannot parallelize two projects when "ProjectA" is a prerequisite (linked into) "ProjectB". Rather, ProjectA will be built, and then ProjectB will be built, (which links in results from the previous ProjectA build). However, "ProjectA.lib" can build in parallel to "ProjectB.lib", when they both are then linked into "ProjectC.exe" (although neither ProjectA nor ProjectB can be built in parallel to ProjectC).

So, depending on your projects, it seems possible that VCBuild only sees a maximum of four projects that are able to be built at the same time?

(NOTE: IMHO, there is no fundamental reason for the two above limitations; Rather, my impression is that both limitations are due to historic internal/technical reasons, since VCBuild isn't really intended to be a "scalable build server".)

charley
  • 5,913
  • 1
  • 33
  • 58