Luoshuang's GPULightmass

It should be in 4.20 anyway

This is so incredably awesome. Just want to say thank you so much!!!

I tryed to bake with swarm, my scene bake in 53s on my first PC, but when i active swarm with 4 PC, i exceed 2 min… any idea? (my version is 4.19 VXGI version rebuild)

Apparently i have a large level that gives me an out of memory error after about 4 hours of rendering on swarm… oddly enough it only takes 8-10 hours to render on default unreal stock renderer on production…

How do i not get out of memory error?

One way is to reduce the quality by setting MappingSurfaceCacheDownsampleFactor in BaseLightmass.ini to higher values like 4 or 8. Also I think you always want to use the fast preview quality preset firstly to check whether you will run into any errors so that you won’t waste time :).

Thanks for the response ill give it a try. What does **MappingSurfaceCacheDownsampleFactor **actually do?

I’m running this error when I try to compile! When I changed to GPU it was OK, but today…I changed two things on my scene and it appears.
Any idea how to repair?

Thanks.

<Nenhum> === Lightmass crashed: ===Unhandled Exception: 0x80000003
Unhandled Exception: 0x80000003

0x000000004322BA51 GPULightmassKernel.dll!UnknownFunction ]
0x000000004312EE02 GPULightmassKernel.dll!UnknownFunction ]
0x0000000043134A0D GPULightmassKernel.dll!UnknownFunction ]
0x000000004313671D GPULightmassKernel.dll!UnknownFunction ]
0x000000007883CFB2 UnrealLightmass.exe!UnknownFunction ]
0x0000000078809691 UnrealLightmass.exe!UnknownFunction ]
0x00000000787B1E41 UnrealLightmass.exe!UnknownFunction ]
0x00000000787DCF32 UnrealLightmass.exe!UnknownFunction ]
0x00000000787FED72 UnrealLightmass.exe!UnknownFunction ]
0x000000007888CF70 UnrealLightmass.exe!UnknownFunction ]
0x00000000B4E93034 KERNEL32.DLL!UnknownFunction ]
0x00000000B6E51551 ntdll.dll!UnknownFunction ]
0x00000000B6E51551 ntdll.dll!UnknownFunction ]

And this is what the Swarm Agent’s Log shows:

17:41:43: [Interface:TryOpenConnection] Local connection established
17:41:43: [Job] Accepted Job 3BAC86BB-42462A52-42C79395-84FFFC22
17:42:00: [Job] Launched Job UnrealLightmass_2018-04-14_15-00-09_1391616-64bit.exe
17:42:00: [Job] PID is 14288
17:42:00: [Job] GUID is “3BAC86BB-42462A52-42C79395-84FFFC22”
17:42:00: LogLightmass: Display: Lightmass Win64 started on: DESKTOP-SNFBN4F. Command-line: 3BAC86BB42462A5242C7939584FFFC22
17:42:00: Failed to determine engine directory: Defaulting to …/…/…/Engine/
17:42:00: Failed to load ‘aqProf.dll’ (GetLastError=126)
17:42:00: File ‘aqProf.dll’ does not exist
17:42:00: Failed to load ‘VtuneApi.dll’ (GetLastError=126)
17:42:00: File ‘VtuneApi.dll’ does not exist
17:42:00: Failed to load ‘VtuneApi32e.dll’ (GetLastError=126)
17:42:00: File ‘VtuneApi32e.dll’ does not exist
17:42:00: Lightmass Win64 started on: DESKTOP-SNFBN4F. Command-line: 3BAC86BB42462A5242C7939584FFFC22
17:42:00: LogLightmass: Display: Processing scene GUID: 3BAC86BB42462A5242C7939584FFFC22 with 6 threads
17:42:00: Processing scene GUID: 3BAC86BB42462A5242C7939584FFFC22 with 6 threads
17:42:00: Building static lighting…
17:42:01: [OpenConnection] Registering TCP channel …
17:42:01: [OpenConnection] Connecting to agent …
17:42:01: [TryOpenConnection] Testing the Agent
17:42:01: [TryOpenConnection] Opening Connection to Agent
17:42:01: [TryOpenConnection] Local Process ID is 14288
17:42:01: [Job] Found a parent connection for PID 14288
17:42:01: [Job] 02D7CA36 → 5D2B620A
17:42:01: [Interface:TryOpenConnection] Local connection established
17:42:01: Skylight import processing 0.006s with CubemapSize 128
17:42:02: Measured CPU frequency: 3.60 GHz
17:42:02: FStaticLightingSystem started using GKDOPMaxTrisPerLeaf: 4
17:42:02: Number of texture mappings: 301
17:42:02: Number of fluid mappings: 0
17:42:02: Number of landscape mappings: 64
17:42:02: Number of BSP mappings: 18
17:42:02: Number of static mesh instance mappings: 301
17:42:03: Reserving memory for 383 meshes, 886983 vertices, 1257695 triangles
17:42:03: Reserving memory for 64 meshes, 97344 vertices, 184832 triangles
17:42:03: Scene surface area calculated at 2298.464 million units (53.518% of the estimated 4294.758 million units)
17:42:03: Importance volume surface area calculated at 1064.637 million units (102.888% of the estimated 1034.754 million units)
17:42:03: Embree Build 0.1s
17:42:03:
17:42:03:
17:42:03: Collision Mesh Overview:
17:42:03: Num Triangles : 1253727
17:42:03: MeshInfos : 0.0Mb
17:42:03: UVs : 9.3Mb
17:42:03: LightmapUVs : 9.3Mb
17:42:03: Embree Used Memory : 92.0Mb
17:42:03:
17:42:03:
17:42:03: Preallocated 0.2Gb for kDOP nodes and triangles
17:42:04: Building kDOP took 0.89 seconds.
17:42:04: Static lighting kDOP: 816964 nodes, 408483 leaves, 1633932 triangles, 884775 vertices
17:42:04: Static lighting kDOP: 23.305% wasted space in leaves
17:42:04: Preallocated 0.0Gb for kDOP nodes and triangles
17:42:04: Building kDOP took 0.11 seconds.
17:42:04: Static lighting kDOP: 931264 nodes, 465634 leaves, 1862536 triangles, 97344 vertices
17:42:04: Static lighting kDOP: 90.076% wasted space in leaves
17:42:04: Processing…
17:42:05: GPULightmass Kernel: Importing mesh: 884775 vertices, 1253320 triangles
17:42:06: GPULightmass Kernel: Embree SBVH Construction finished, 465MS
17:42:06: GPULightmass Kernel: Convert to CudaBVH finished, 501MS
17:42:07: GPULightmass Kernel: GPU BVH video memory size: 36.64MB, triangle payload size: 87.84MB
17:42:07: GPULightmass Kernel: Bind CudaBVH finished, 407MS
17:42:07: GPULightmass Kernel: GPU triangle parameterization data size: 32.62MB
17:42:07: GPULightmass Kernel: 64 masked collision maps imported
17:42:07: GPULightmass Kernel: 2 point lights and 3 spot lights imported
17:42:07: Started task graph with 4 named threads and 10 total threads with 1 sets of task threads.
17:42:13: GPULightmass Kernel: Total surface cache video memory data: 2009.42MB
17:42:13: GPULightmass Kernel: RadiosityPass 0
17:42:38: GPULightmass Kernel: Line 475: cudaCheckError: unspecified launch failure

Follow the instructions in the main post to change your TDR settings.

“Follow the instructions in the main post to change your TDR settings.”

you mean the first page? What is the name of the main post in case if its not the first page, please?

You can easily find that thing by pressing Ctrl+F on the first page and type “TDR”. :slight_smile:

Thank you very much!!!

Not even through .ini file setting ?

The total number of samples taken by the Brute Force GI Engine is fixed:

Fast Preview: 16 * 16 * 2 = 512
Medium Quality: 32 * 32 * 2 (Fixed) + 32 * 32 * 2 (Adaptive) = 4096
Ultra High: 64 * 64 * 2 (Fixed) + 64 * 64 * 2 (Adaptive) = 16384

However, the secondary radiosity caching GI engine does accept a parameter to reduce/increase the quality: MappingSurfaceCacheDownsampleFactor (minimum 1) in BaseLightmass.ini. Basically the engine uses your lightmap resolution as a reference and divides it by the downsample factor to deduce the final indirect lighting resolution. Raising the downsample factor can reduce video memory consumption but can also introduce leaks. A workaround is to split the lightmap UV at where the lighting leaks.

Right, but I don’t really want to have 3 different custom engines built. That’s why I wonder why not to put total number of samples into .ini so that people (including myself) only need to build 1 copy of the engine and then restart it (after changing .ini settings) to be able to build either Fast Preview or Ultra High quality.

That’s why this is an early version :slight_smile:

Curious, when will you support lod and hlod lighting properly when over lapping causes the black lightmaps…?

for those of you who have problems with grainy/splotchy lightmaps.
you can workaround this by upping the indirect lighting intensities of your lights from 1 to 3-6. depends on the lighting situation and the light intensity of the light.
if your scene then gets too bright, you can cramp up the eye adaption/exposure min/max brightness settings. to something like 0.4-0.5 also highly depends on your environment and lighting situation. but this way i can also use the GPU baker in critical conditions.
not ideal, since f*cking with the post process settings will also affect your exterior views and quickly you changed the complete nice lighting settings you had…but well it is a workaround

Thanks a lot for reply but it doesnt work with me. May be GTX 770 isn’t support for this tool or my computer has an error

I am getting this in the output log:
Timed out while waiting for GPU to catch up.

I have tweaked the TDR settings as required. Seems the renderer resorts back to cpu to do the baking as the gpu tab that comes up doesn’t and the original black blacking progress bar comes up.
This seems to happen after I tweak the following:

Are we supposed to tweak the Volumetric Lightmap settings when using GPU lightmass baker?
I am using GTX 780M. I am guessing this might have issues since its an older card?