EPIC: Building new code project fails ( Hardware Configuration Problem? )

This is a bit of an extension of the question I wrote here: UnrealBuildTool files gone? Invalid Class when building - C++ - Unreal Engine Forums

Hopefully someone from epic can help me solve this problem. It is severely disrupting the workflow here. Especially when it comes to patches and updates of the engine.

These are my repo steps:

  1. download a fresh version of the engine using the launcher (4.2.1 here)

  2. Launch Engine

  3. Create new Basic Code Project, Visual studio launches.

  4. Compile new Project and get following error.

    1>------ Build started: Project: ShadowHeroesGame, Configuration: DebugGame_Editor x64 ------
    1> Parsing headers for ShadowHeroesGameEditor
    1> Code generation finished for ShadowHeroesGameEditor and took 3.088
    1>EXEC : error : System.Management.ManagementException: Invalid class
    1> at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
    1> at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
    1> at UnrealBuildTool.LocalExecutor.ExecuteActions(List1 Actions) 1> at UnrealBuildTool.UnrealBuildTool.ExecuteActions(List1 ActionsToExecute, String& ExecutorName)
    1> at UnrealBuildTool.UnrealBuildTool.RunUBT(String[] Arguments)
    1> Cumulative action seconds (8 processors): 0.00 building projects, 0.00 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
    1> UBT execution time: 10.07 seconds
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““F:\UE4\Unreal Engine\4.2\Engine\Build\BatchFiles\Build.bat” ShadowHeroesGameEditor Win64 DebugGame “C:\Users\Justin\Documents\Unreal Projects\ShadowHeroesGame\ShadowHeroesGame.uproject” -rocket” exited with code -1.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Looking into it, this is a problem with the unreal build tool. Specifically, inside LocalExecutor.cs What I have needed to do in the past was go to line 299 and comment out the following block.

// Use WMI to figure out physical cores, excluding hyper threading.
			int NumCores = 0;
			if (!Utils.IsRunningOnMono)
			{
				foreach(var Item in new System.Management.ManagementObjectSearcher("Select * from Win32_Processor").Get())
				{
					NumCores += int.Parse(Item["NumberOfCores"].ToString());
				}
			}

Then everything works just fine. But it requires me to download the GitHub source which removes my ability to use a lot of the content examples because they are for slightly new versions. Re downloading the engine and recompiling it whenever an update happens is also a pain given that I have to go in the settings of each project and re-target them each time.

Now, given that this is likely an issue with the specific cpu configuration, my main question is what could I change to prevent this from continuing to happen. given that the code that causes the problem is using “WMI to figure out physical cores, excluding hyper threading”, I’d love to know what that means and how it works. Perhaps this can point me in the correct direction so I can tweak my hardware. Maybe it’s a configuration not supported by UE4 or something not accounted for that could be patched (though I hope it’s something local I can change).

Attached Here are my cpu, mainboard and memory specs. Maybe there is a hardware conflict that can be spotted.

Well, I appear to have solved this problem. My own frustration caused me to dig into it a lot deeper then I would usually. I had 2 problems apparently.

To begin with, I had to download the WMIdiag tool from Microsoft Here.

Next I run it as an admin but it hung. Looking into why, I found that it was likely because my WMI repository was corrupt so I ran the following script to rebuild the repository as a bat file. (credit CC Hameed for this post )

@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver 
winmgmt /regserver 
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s

That allowed the diag to run. but I found that the problem was that I didn’t have a wmi directory listed in my Path environment variable for the USER It had to be user for some reason. System was not enough. Doing that left me with some other errors that where performance classes that where not being found.

Running Winmgmt /resyncperf from the command prompt appears to have resolved those. Now I can happily compile.

Hope this helps anyone who has the same problem I did.

I just got an email saying I’ve been mentioned in this post.
It appears that @echo in the code sends me an email when it’s posted. XD

Well that’s interesting to know. I’m actually quite surprised this is the first time it has happened.