Why can't I build lighting?

So I’m trying to build lighting and it keeps giving me these two errors:
The first one is a map check error and it says: WorldSettings_1 Maps need lighting rebuilt

And the other one says:

 === Lightmass crashed: ===
Assertion failed: rtcDeviceGetError(EmbreeDevice) == RTC_NO_ERROR [File:D:/Build/++UE4/Sync/Engine/Source/Programs/UnrealLightmass/Private/Lighting/Embree.cpp] [Line: 721] 

0x00007ffdb3767c17 UnrealLightmass-Core.dll!UnknownFunction []
0x00007ff7c8564e63 UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::PrepareForRaytracing() []
0x00007ff7c85874d9 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
0x00007ff7c853a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
0x00007ff7c85610d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
0x00007ff7c857f8d3 UnrealLightmass.exe!main() []
0x00007ff7c85e6c64 UnrealLightmass.exe!__scrt_common_main_seh() []
0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []



0x00007ffe415ed759 KERNELBASE.dll!UnknownFunction []
0x00007ffdb39a3276 UnrealLightmass-Core.dll!UnknownFunction []
0x00007ffdb39a6657 UnrealLightmass-Core.dll!UnknownFunction []
0x00007ffdb37d3aed UnrealLightmass-Core.dll!UnknownFunction []
0x00007ffdb37658f5 UnrealLightmass-Core.dll!UnknownFunction []
0x00007ffdb3767c50 UnrealLightmass-Core.dll!UnknownFunction []
0x00007ff7c8564e63 UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::PrepareForRaytracing() []
0x00007ff7c85874d9 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
0x00007ff7c853a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
0x00007ff7c85610d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
0x00007ff7c857f8d3 UnrealLightmass.exe!main() []
0x00007ff7c85e6c64 UnrealLightmass.exe!__scrt_common_main_seh() []
0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []


Also, I checked the swarm agent log and this is what I got:

11:01:14 PM: [Interface:TryOpenConnection] Local connection established
11:01:14 PM: [Job] Accepted Job DEF6718D-43867996-5121C18B-82846E43
11:01:16 PM: [Job] Launched Job UnrealLightmass_2020-11-14_04-48-22_1126144-64bit.exe
11:01:16 PM: [Job]     PID is 3812
11:01:16 PM: [Job]     GUID is "DEF6718D-43867996-5121C18B-82846E43"
11:01:16 PM: LogLightmass: Display: Lightmass Win64 started on: JOKER. Command-line: DEF6718D438679965121C18B82846E43
11:01:16 PM: Failed to determine engine directory: Defaulting to ../../../Engine/
11:01:16 PM: Failed to load 'aqProf.dll' (GetLastError=126)
11:01:16 PM: File 'aqProf.dll' does not exist
11:01:16 PM: Failed to load 'VtuneApi.dll' (GetLastError=126)
11:01:16 PM: File 'VtuneApi.dll' does not exist
11:01:16 PM: Failed to load 'VtuneApi32e.dll' (GetLastError=126)
11:01:16 PM: File 'VtuneApi32e.dll' does not exist
11:01:16 PM: Lightmass Win64 started on: JOKER. Command-line: DEF6718D438679965121C18B82846E43
11:01:16 PM: LogLightmass: Display: Processing scene GUID: DEF6718D438679965121C18B82846E43 with 3 threads
11:01:16 PM: Processing scene GUID: DEF6718D438679965121C18B82846E43 with 3 threads
11:01:16 PM: Building static lighting...
11:01:16 PM: [OpenConnection] Registering TCP channel ...
11:01:16 PM: [OpenConnection] Connecting to agent ...
11:01:16 PM: [TryOpenConnection] Testing the Agent
11:01:16 PM: [TryOpenConnection] Opening Connection to Agent
11:01:16 PM: [TryOpenConnection] Local Process ID is 3812
11:01:16 PM: [Job] Found a parent connection for PID 3812
11:01:16 PM: [Job]     0095AB68 -> 381F1393
11:01:16 PM: [Interface:TryOpenConnection] Local connection established
11:01:16 PM: Skylight import processing 0.006s with CubemapSize 128
11:01:27 PM: Measured CPU frequency: 3.19 GHz
11:01:27 PM: FStaticLightingSystem started using GKDOPMaxTrisPerLeaf: 4
11:01:27 PM: Number of texture mappings: 279
11:01:27 PM: Number of fluid mappings:   0
11:01:27 PM: Number of landscape mappings:   64
11:01:27 PM: Number of BSP mappings:     254
11:01:27 PM: Number of static mesh instance mappings: 279
11:02:05 PM: LogMemory: Warning: MemoryStats:
11:02:05 PM:     AvailablePhysical 494026752
11:02:05 PM:      AvailableVirtual 140719372382208
11:02:05 PM:          UsedPhysical 9470799872
11:02:05 PM:      PeakUsedPhysical 9561763840
11:02:05 PM:           UsedVirtual 13043851264
11:02:05 PM:       PeakUsedVirtual 13073334272
11:02:05 PM: MemoryStats:
11:02:05 PM:     AvailablePhysical 494026752
11:02:05 PM:      AvailableVirtual 140719372382208
11:02:05 PM:          UsedPhysical 9470799872
11:02:05 PM:      PeakUsedPhysical 9561763840
11:02:05 PM:           UsedVirtual 13043851264
11:02:05 PM:       PeakUsedVirtual 13073334272
11:02:05 PM: Allocator Stats for TBB: (not implemented)
11:02:05 PM: Windows GetLastError: The operation completed successfully. (0)
11:02:05 PM: Exception handled in main, crash report generated, re-throwing exception
11:02:05 PM: Exception handled in main, calling appHandleCriticalError
11:02:05 PM: LogLightmass: Error: === Critical error: === 
11:02:05 PM: 
11:02:05 PM: Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMemory.cpp] [Line: 186] 
11:02:05 PM: Ran out of memory allocating 28094288 bytes with alignment 0
11:02:05 PM: 0x00007ffdb3761a38 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb37f7116 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aeceaec UnrealLightmass.exe!TArray >::ResizeGrow() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae8c17c UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae95fbb UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aee67b5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae9a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aec10d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aedf8d3 UnrealLightmass.exe!main() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64af46c64 UnrealLightmass.exe!__scrt_common_main_seh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 0x00007ffe415ed759 KERNELBASE.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3af3276 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3af6657 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3923aed UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3761a60 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb37f7116 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aeceaec UnrealLightmass.exe!TArray >::ResizeGrow() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae8c17c UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae95fbb UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aee67b5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae9a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aec10d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aedf8d3 UnrealLightmass.exe!main() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64af46c64 UnrealLightmass.exe!__scrt_common_main_seh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: === Critical error: === 
11:02:05 PM: 
11:02:05 PM: Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMemory.cpp] [Line: 186] 
11:02:05 PM: Ran out of memory allocating 28094288 bytes with alignment 0
11:02:05 PM: 0x00007ffdb3761a38 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb37f7116 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aeceaec UnrealLightmass.exe!TArray >::ResizeGrow() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae8c17c UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae95fbb UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aee67b5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae9a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aec10d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aedf8d3 UnrealLightmass.exe!main() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64af46c64 UnrealLightmass.exe!__scrt_common_main_seh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: 0x00007ffe415ed759 KERNELBASE.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3af3276 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3af6657 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3923aed UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb3761a60 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffdb37f7116 UnrealLightmass-Core.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aeceaec UnrealLightmass.exe!TArray >::ResizeGrow() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae8c17c UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae95fbb UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aee67b5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64ae9a529 UnrealLightmass.exe!Lightmass::BuildStaticLighting() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aec10d7 UnrealLightmass.exe!Lightmass::LightmassMain() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64aedf8d3 UnrealLightmass.exe!main() []
11:02:05 PM: 
11:02:05 PM: 0x00007ff64af46c64 UnrealLightmass.exe!__scrt_common_main_seh() []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe41d07034 KERNEL32.DLL!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 0x00007ffe439dd0d1 ntdll.dll!UnknownFunction []
11:02:05 PM: 
11:02:05 PM: 
11:02:05 PM: LogWindows: Warning: CreateProc failed: The system cannot find the file specified. (0x00000002)
11:02:05 PM: CreateProc failed: The system cannot find the file specified. (0x00000002)
11:02:05 PM: LogWindows: Warning: URL: ../DotNET/AutoReporter.exe 3812 "UE4AutoReportDump.txt" "UnrealLight_JOKER_1CD505F44F8459D168FF638F8DDD2B50.log" "UE4AutoReportIniDump.txt" "" -unattended
11:02:05 PM: URL: ../DotNET/AutoReporter.exe 3812 "UE4AutoReportDump.txt" "UnrealLight_JOKER_1CD505F44F8459D168FF638F8DDD2B50.log" "UE4AutoReportIniDump.txt" "" -unattended
11:02:05 PM: LogLightmass: Error: Couldn't start up the Auto Reporting process!
11:02:05 PM: Couldn't start up the Auto Reporting process!
11:02:05 PM: *** CRITICAL ERROR! Machine: JOKER
11:02:05 PM: *** CRITICAL ERROR! Logfile: UnrealLight_JOKER_1CD505F44F8459D168FF638F8DDD2B50.log
11:02:05 PM: *** CRITICAL ERROR! Crash report: 
11:02:05 PM: [CloseConnection] Closing connection 381F1393 using handle 381F1393
11:02:05 PM: [CloseConnection] Connection confirmed for disconnection 381F1393
11:02:05 PM: [CloseConnection] Connection disconnected 381F1393
11:02:05 PM: [GetMessage] Safely returning to 381F1393 with no message
11:02:06 PM: [MaintainConnections] Local connection has closed (381F1393)
11:02:06 PM: [MaintainConnections] Removed connection 381F1393
11:02:06 PM: [Job] Job has failed! Job executable didn't exit cleanly. Exit code: 1
11:02:06 PM: [CloseConnection] Closing connection 0095AB68 using handle 0095AB68
11:02:06 PM: [CloseConnection] Connection confirmed for disconnection 0095AB68
11:02:06 PM: [CloseConnection] Closing orphaned Job (DEF6718D-43867996-5121C18B-82846E43)
11:02:07 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:07 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:08 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:08 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:09 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:09 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:10 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:10 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:11 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:11 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:12 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:12 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:13 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:13 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:14 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:14 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:15 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:15 PM: [MaintainConnections] Connection 0095AB68 is DISCONNECTING
11:02:16 PM: [CloseConnection] Connection disconnected 0095AB68
11:02:16 PM: [GetMessage] Safely returning to 0095AB68 with no message
11:02:16 PM: [MaintainConnections] Local connection has closed (0095AB68)
11:02:16 PM: [MaintainConnections] Removed connection 0095AB68
11:02:16 PM: [MaintainConnections] All connections have closed

Any idea how to fix this?

Check that your Swarm cache doesn’t contain corrupt data:

  • Open the swarm agent by double clicking the swarm agent icon in the task bar (it may not be visible until you’ve already tried to build lighting).
  • Select Cache | Clean and then Cache | Validate from the menu
  • Check the Log tab to see whether it’s happy.

I actually fixed the problem a while ago. It’s been a long time since I posted this question and I kinda forgot about it.
If I remember correctly, the problem was with a mesh. I think it had way too many vertex and I had a lot of copies of that mesh in the level (it was a fence and I had like 100 copies of it) and also there was a lot of overlapping in the UVs for that meah. So I fixed the UVs and reduced the number of vertex and it worked. Or at least that’s how I remember I fixed it.
Thanks for the answer anyway.
:slight_smile: