Download

Visual Studio 2022 Preview is 64 bit and compiles and runs UE 5.0 EA approximately 20% FASTER

For many people out there the cutting edge is about performance, speed of execution, speed of compiling Shaders.
Visual Studio 2022 64 bit takes 27 seconds, uses 1.1GB peak to load UE5 source and be ready to edit.
Visual Studio 2019 32 bit takes 2minutes 23, 630k Peak and takes 2 minutes 23 seconds to be ready
on a 16GB Win 10 latest build PC.

UPDATE:- Visual Studio 2022 Preview has been updated and is according to the road map will be updated each month until final release. Feedback below shows that Visual Studio 2019 needs to be installed first before Visual Studio 2022 Preview to run the original code

UPDATE 2 A Fork repository to build Unreal 5 Early Access with Visual Studio 2022 Preview

I have built Visual Studio 2022 Preview is 64 bit and compiles and runs UE 5.0 EA
I can literally count less seconds initially generating a new project.
So this is how to build UE50EA2 using Visual Studio 2022 Preview

Download Visual Studio 2022 Preview
This has been a good project to fork a repository on GitHub of the original code to another branch.
To load the update branch in Git CMD point to the branch on GitHub with
$ git remote set-url --add --push origin https://github.com/jimshalo10/UnrealEngine-5.git
$ git clone https://github.com/jimshalo10/UnrealEngine-5.git -b ue5EA-vs2022
$ cd ue5EA-vs2022
$ setup.bat
$ GenerateProjectFiles.bat -2022

I tested this by disabling VS 2019, to make sure VS2022 Preview was doing all the work.

I have added extra code to see which Visual Studio is loaded
4>Found Visual Studio installation: C:\Program Files\Microsoft Visual Studio\2022\Preview (Product=Microsoft.VisualStudio.Product.Community, Version=17.0.31423.177)
4>Found Visual Studio installation: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community (Product=Microsoft.VisualStudio.Product.Community, Version=16.10.31410.357)
4>Found Visual Studio installation: C:\Program Files\Microsoft Visual Studio\2022\Preview (Product=Microsoft.VisualStudio.Product.Community, Version=17.0.31423.177)

When the build starts the status line is printed by UE5
4>Using Visual Studio 2022 14.29.30130 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.29.30130)
and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).

Download Git Bash from Git - Downloading Package for Windows 10
REM install Git command. The open it

C:\Users\Owner\source\repos> ren UnrealEngine UE50EA
C:\Users\Owner\source\repos\ue50EA>setup.bat

C:\Users\Owner\source\repos\ue50EA>
REM in Windows Explorer open the above repository path Right Click on UE5.sln and Select Visual Studio 2022 Preview
REM Visual Studio 2022 Preview opens in Solution Panel Right click UE5 and Select “Set as Start-up Project”
REM in Solution Panel Right click UE5 and Select Build.
REM My PC with SSD and 6 core processor,16GB Memory and 16GB page file Builds in 4712 second approximately 78 minutes.

When built Debug → Start without debugging.
I am getting about 20% improvement as everything is built as 64 Bit in Visual Studio 2022 Preview.

There is a great performance improvement in building Shaders and converting Static Meshes to Nanite, possibly two seconds less. The Unreal Editor no longer has the 4GB memory limit. Therefor it can converted several hundred Static Meshes to Nanite in one command with the working memory over over 6GB whist converting

The more people test this using the above procedure the more influence Unreal Engine 5.0 will have on Visual Studio 2022 final release, in terms of performance in compiling for Unreal Engine 5.0 and packaging of the final game.

Using Visual Studio 2022 Preview there is a significant performance boost for the Valley of The Ancient demo

3 Likes

Keep in mind that the current Visual Studio 2022 preview does not contain an updated MSVC Toolset (i.e. the compiler is the same as the one in Visual Studio 2019). That will be added in the next preview (see https://www.reddit.com/r/cpp/comments/o28rf1/visual_studio_2022_preview_1_now_available/h26cz55/). Any improvements you’re seeing are purely because the IDE itself is more performant. It should not impact the performance of built applications (including Unreal Engine), unless you’re running the IDE at the same time.

I’m also using the 2022 preview, but all I’m doing is right-clicking my Visual Studio solution and clicking “Open with Microsoft Visual Studio 2022 Preview”. Other than that, everything works right out of the box for me, no noticeable bugs. I expect it to be harder to get the Unreal Header Tool to use the new compiler in the next preview.

Sorry, I’m a noob with Unreal Engine, but some of this post still applies to me as well. I installed Visual Studio 2022 Preview for pretty much the same reason, but I installed UE5 throught the Launcher. Unfortunately, it appears UE5 can’t find VS 2022 and since it gives me error: “No compiler was found. In order to use a C++ template, you must first install Visual Studio 2019”.

I’ll still be trying to compile the whole engine, but I want to know in advance if the performance improvement for the demo Valley of the Ancients is noticeable even compared to the official UE5 build.

Also, how can I use Visual Studio 2022 instead of 2019 for the project, will compiling UE5 in VS 2022 solve the problem?

Thanks in advance.

When you load via the Epic Launcher, you are using the Epic Launcher Pre Compiled Binary version, which I believe goes live with 5.0 EA " on 25th June?. I am building from the Git hub source not the zip file. I have already got VS 2019 loaded, and like @Knauric has said the complier probably shares with VS2019. When we moved from VS2017 to Vs2019 initially we need to have VS2017 loaded as well as VS2019, because some code was initially shared or pointers needed adding. I would in hindsight, load VS2019 as well as VS 2022.

The Valley of the Ancient relies on the faster graphics card than mine. However the code seems to run quicker and on a slower graphics card this is noticeable, but if I had a fast graphics card I dont know if it would be that much faster!.

My motive for all this has been to find any bugs or problems, which will get fixed quicker. The Visual Studio teams always want people with big projects to test, or try and break, the new compilers, and that’s what I like doing! :slight_smile:

1 Like

Thanks for clearing up my doubts. Am installing VS 2019 now.

Hi @Knauric and @makuc I have made a new fork repository which will build and run in Visual Studio 2022 Preview without VS2019. I have updated the First post.
Thanks

1 Like

Hi,
My build fails with the following error:
CMakeCCompilerId.c.obj : error LNK2005: main already defined in Module.ResonanceAudio.cpp.obj
Can someone advice please?

Hi @PaGo, This is some sort of problem with the linker. I got around this by Executing a Right Click on UE5.sln Project and select “Set as Startup Project”.
Right, Click and Select “Clean” this will delete the corrupted projects.
Right Click on UE5.sln Project and select “Build”.
This should now build UE5. Got to Menu View → Select “Output” and watch the compiler building

Doesn’t work… can’t create c++ projects with VS 2022

Hi @Marius_Sheppard
This is a carry through from UE 4 where they wanted VS 2015/2017 installed. In UE5 they just changed the line from 2017 to 2019.
Now I will have to fix the problem in my VS2022 Fork.
I will report here when fixed. UE5 BP C++ code generator creates a blank BP C++ in VS2022 correctly.
This section is historic code so it’s hard to read.

In UE4 .24/27 if you don’t have 2017 installed you get the same problem, hence why the Readme.md was carried over from UE4 I assume.

1 Like

For anyone watching this thread who are unaware:

Visual Studio 2022 Preview 2 has been released, which includes updated C++ build tools (notably including the updated compiler).

2 Likes

Hi @Marius_Sheppard, There is progress with getting UE50EA2 to create C++ projects.
I now have VS2019, building C++ projects correctly. Previously there was a problem carried over from UE4 that needed VS2017 installed. I will now work on getting VS2022 compiling projects.

To all those following this thread please load the latest update Preview 2. The debug symbols load is now so fast. The new compiler has taken 480 seconds of compile build time of UE50EA as its all 64 bit

For the Graphics Content designer, have a look at the new icons and send feedback when you create a new project in the VS2022 preview.
It’s awesome with Preview 2 my conversion of the Epic Marketplace Infiltrator example from UE4 to UE5 its 10GB project have to be held inside UE5. The total memory used was beyond 12GB whilst running the shader compilers, all eleven, as each shader compiler run completed another item appeared in the window.
Goodbye 32bit 4GB memory limit!.

Please load the UE5EA and build it from the source with VS2022 as described above.
We UE5EA group are building one of the biggest test projects for VS2022 Preview.

This is influencing the performance of the final version of VS2022, the MS Compiler Engineering teams are looking at the performance statistics for compiling UE50 and execution of the UE50EA code and the more people test this the better for the future of UE50

@Jimbohalo10 thank you very much for posting this guide and hosting the repository that works with VS2022 preview 2.

Last night after not touching the engine (or game dev) in a while, I installed VS2022 and build UE5EA from your repository and it seems to work (just getting home, need to mess around with it to be sure). One thing I noticed when building the UE5 solution is that seldom did my memory usage ever go above 2GB. The entire process took about 4 hours, is that normal? (PC is Ryzen 5 3600X 6-Core, 16GB Ram)

 ---------------------- Done ----------------------
  
      Rebuild All: 1 succeeded, 0 failed, 0 skipped
  
  1 build system warning(s):
     - License is invalid
  
  Total time in XGE executor: 14441.61 seconds
  Total execution time: 14621.10 seconds

Hi @Star_Dust ,
Yes , this is normal on this specification of machine, to decrease the speed compilation you need and Sold State disk and 32GB memory and possibly a 64GB pagefile.

That aside I am glad the build works ok for you, as your System is well below the minimum spec for UE50AE.
My system is below the recommended system specification as well, but with patience I managed to develop this