RYZEN CPU 2700x (8 core 16 thread) only using 35% when building lighting in UE4

Just bought a new CPU RYZEN 2700x (8 core 16 thread) It’s a beast yet when I build the lighting in unreal engine (the main purpose I bought it for) only about 40% is used?

I’ve tested it on 4.18.3 and 4.19.2

AMD Ryzen is a CPU. I wonder if lightmass can’t parallelize enough to use all the cores? I think I read somewhere that each lightmass performance is limited to the largest mesh so if you only have a few huge meshes you wont be able to parallelize the workload as well

I found where I read it, this is from the docs:

“Optimize the lightmap resolutions across the map so that build time for meshes is more even. The lighting build can never be faster than the slowest single object, regardless of how many machines are doing the distributed build. Avoid large continuous meshes that surround a large part of the level and with high lightmap resolution. You will get better build times if you break these up into more modular pieces, especially on machines with many cores.”

Each thread can only work on one object at a time, so it may not need the resources

This is not the case with my level, I have lots of small to medium sized meshes (about 3000 meshes). It is not my level either because I’ve tried different levels and on different engine versions.

Any other ideas? I’ve been thinking that it’s probably the fact the Epic hasn’t optimised for RYZEN CPU’s?

And the problem is not my CPU or computer because compiling shaders uses 100% of my CPU and it’s lightning fast.

I know to some degree it won’t use all of your computer resources otherwise you won’t be able to do much with your system while it’s running, I think there’s some settings in Swarm for configuring how it uses some cores.
There’s nothing in UE4 that’s optimized more for one manufacturer, they don’t want those types of features in the engine

Do you know how I can access these swarm settings? And Swarm ***is ***supposed to use 100% CPU but it takes lower priority than windows so it doesn’t cause too
much lag. With my old PC: AMD FX6300 and the one I use in college: Intel i7 7700- It uses 100% CPU when building lighting.

You can check out the swarm settings by opening up the lightmass swarm icon from the taskbar and then enabling developer options - then in the develop settings tab you will see options for configuring how many cores are used and the priority of the lightmass threads

You have to change your Swarm Settings so that it increases your CPU usage

In the Swarm Window unhide the Dev Tab → Settings Tab → Show Developer Menu → True

From Developer Settings tab you can increase the CPU usage by Changing the LocalJobPriority from Idle to Normal

I’ve fixed my issue :slight_smile: I had to go into the developer settings of swarm and set the LocalJobsDefaultProcessorCount from 6 to 16 (because I have 16 threads) and it’s using 100% CPU usage when building lighting. The only issue is that it seems I have to change it from 6 to 16 every time I open UE4.

Thanks for posting how you resolved it, have changed mine to 12.

As for the problem of not saving, try this. First close down any UE4Editor sessions and make sure Swarm isn’t running, then navigate to:
C:\Program Files\Epic Games\UE_4.19\Engine\Binaries\DotNET

In Windows Explorer and double click on SwarmAgent.exe. In the program enable the DeveloperSettings from the normal Settings tab, then set the number of threads you want to use.

This creates a SwarmAgent.DeveloperOptions.xml file in the same folder with the number of thread set. You shouldn’t need to edit this for Swarm anymore while in version 4.19 (or whichever version you are on), but keep a copy of that XML file handy so you can just paste it into the next version of UE4 you download.

Hope that helps, it seems to work ok on my end. :slight_smile:

On a side note, there is a GPU based Swarm version being developed by Luoshuang, you can try it out from here, it should be integrated into UE4 very soon:…s-gpulightmass

I wish the guy doing the GPU lightmass would port it to all platforms instead of just NVidia

You’re more than welcome to take a crack at writing the ray tracer in OpenCL instead of CUDA…

From what I’ve heard, it seems Epic is already working on this to an extent. I think they’re working on a real-time view-port baked lighting renderer like what unity has.

AMD said they’re working to support the new raytracing feature, so it won’t be limited just to Nvidia.

Id love to know your lighting time build improvements. I have one I got for lighting builds but Im debating keeping it and just swapping out to an 8700k. Coming from a2500K here btw

ditto, b4 I sink 2much into this I"d like very much to know the gain-

In theory, you should absolutely be correct but I am beginning to have my doubts. This issue has not gone away with the 3950x. It is definitely not utilizing the cpu cores as it should. It utilizes all of the Intel cores at 100% throughout the build and the computer does not crash.

Hi arcitek, that’s beginning to worry me a little bit. I just got a Ryzen 5 3600 as a starting position, but from what you’re saying I’m wondering if that’s a huge mistake ? Are you absolutely sure you have swarm configured right , etc. ? Just asking bc this is a big deal for all of us.

I wish I could tell you I am a computer expert but I am not. My buddy who is working on the same Unreal project through an Epic Grant is more well versed in computer hardware and he has the exact same configuration and both of us are seeing this issue. If we throw the project onto Intel based machines, the utilization during the full light build is better on the Intel. Trust me, after spending 3,000 dollars on my recent Ryzen 3950x build, I wish someone, anyone could tell me how to fix this. If you check out my thread I posted, A few great people have provided some feedback to me that had made sense but it still does not seem to fully explain the issue. As mentioned in the thread, download the grocery scene that is free this month in Marketplace and do a ligh build using preview. Open your task manager first and have it up when you run the build and tell me what your CPU utilization is during the light build. I am pretty sure you will see it drop substantially during the radiosity portion.…n-and-intel-i7