Luoshuang's GPULightmass

So great to hear! Thanks for confirming :slight_smile:

Hi All,
I have discovered a new packaging problem in the D3D12adapter.cpp (DirectX D12) when attempting to package LGPU baked projects for GTX adapters.

The way around this for everyone was to bake and package using the Direct X11.
Several symptoms occur, the main one being that the picture is dark, blotchy etc when using DirectX 12.

The normal question is works in UE Editor but exe wont run correctly and looks like the baking/cooking has failed, on Nvidia GTX 10xx card. The reason the code was put in D3DX12 was to remove debug code and enhance performance of Direct X12.

This packaging problem was first discovered in path tracer for GTX cards.
I am putting in a cross reference to my post,

Solved : Cant Enable RayTracing in UE5 (GTX10xx) DX12 packaging problem

Epic GPULlightmass potential packaging problem

The problem for Epic GPULightmass using DXR, is you cannot switch to DX11, because DXR is only available using r.D3D12.DXR.AllowEmulatedRayTracing for “Allows ray tracing emulation support on NVIDIA cards with the Pascal architecture”.

Hey folks. I was doing some test using LUGPU (5.1) and realize how hot my GPU gets. Something crazy like 90C while the Epic GPU don’t get that hot, something like 60C. I’m using a RTX 4070. Did any of you guys faced something similar? Thanks in advane.

hi @michaelmonte ,
I have looked at the Nvidia CUDA and LGPU kernel code. When originaly written, the code went and called CUDA code to ask how many GPU cores were on the GTX graphics card and then shared out the baking based on that number of cores on .

Therefore as newer RTX would many more cores on them the code went faster and hence your card, as does my old GTX graphics card, get much hotter as they work at full capacity. your RTX 4070 has 5888 CUDA cores

The fans start running at full speed to cope with the increased workload.

The reason Epic GPU Lightmass runs cooler is they use Directx DXR and cannot access the number of GPUs available.
Epic Epic GPU Lightmass therefore had to have a fixed number and this seems to correspond to the RTX 2060 with 1,920 CUDA cores. Directx DXR was made to support Nvidia and the new AMD graphics cards.

Therefore RTX 4070 using LGPU runs hotter because it using over 5000 cores to bake.
Epic GPU Lightmass uses about 1900 cores of RTX 4070 and therefore runs cooler as this is only 38% capacity of the RTX4070. Basically, to use a motoring analogy, RTX 4070 never gets out of first gear with Epic GPU Lightmass. When running with LGPU it runs like a Ferrari.:rofl::rofl:

If you really want to try and see how fast/hot your GPU can go try this it even works on GTX1050 and getting 67 FPS!.

FurMark - GPU Stress Test | Tutorials (tenforums.com)

1 Like

Interesting @Jimbohalo10 !

For curiosity, is there any way to raise the number of used cores in the Epics gpul?

I have said them (Epic devs) that Epic’s one is slower than Luoshuang’s one, but they never mentioned that it happens because it’s more limited, intentionally.

hi @Miguel1900 ,
There is a whole manual from Nvidia about this and for me as Hardware/Software engineer its a good read for me!.

NVTechNotes_Notebook-003.book (nvidia.com)

However, if the application or the Optimus driver are configured to use the NVIDIA 
High Performance Graphics hardware through one of the methods listed in Methods 
That Enable NVIDIA High Performance Graphics Rendering on Optimus Systems, then 
information about the NVIDIA High Performance Graphics hardware and its 
corresponding capabilities is made available to the application.

The NVIDIA driver monitors certain runtime APIs and returns the appropriate NVIDIA 
hardware information through calls made by the application to those APIs.

The following are the APIs that applications can use:
 DirectX9 and above – IDXGIAdapter::GetDesc
 OpenGL – glGetString(GL_VENDOR) and glGetString(GL_RENDERER

The trick is finding someone in Epic to implement the code
Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU (github.com)

The code that need implementing in CUDA is here in this article
In c - How can I get number of Cores in cuda device? - Stack Overflow
I am trying and I am not asking to use Directx DXR :rofl::joy::grin::grin:

Lets face they are :sleeping::sleeping::yawning_face:

This unfortunately is low level stuff and not DXR, DX12 etc

If you really want to try and see how fast/hot your GPU can go try this it even works on GTX1050 and getting 67 FPS!.

FurMark - GPU Stress Test | Tutorials (tenforums.com)

Hahaha, ouch! I’m not understanding almost anything :rofl: I’m more like a technical artist, but not a programmer.

Yep, Furmark is crazy, but I was not only interested about getting it hot, haha, but about making Epic’s GPUL faster (using all the cores) to compare it versus Luos GPUL (our very favourite! Right?)

The most important bit is
DXR does not introduce a new GPU engine

This the extract from the Microsoft Announcement for DXR

You may have noticed that DXR does not introduce a new GPU engine to go alongside DX12’s existing Graphics and Compute engines. This is intentional – DXR workloads can be run on either of DX12’s existing engines.

DXR will initially be used to supplement current rendering techniques such as screen space reflections

A new command list method, DispatchRays, which is the starting point for tracing rays into the scene. This is how the game actually submits DXR workloads to the GPU.

This is so far behind LGPU, the number of GPUs allocation cannot even be controlled in the Epic GPUL.

A new command list method, DispatchRays, which is the starting point for tracing rays into the scene.

This is how the game actually submits DXR workloads to the GPU

Open GL is slow and always will be as its got to cover Linux, MacOS and Windows Open CL is just the same. Microsoft is all Open Source now and hence based Direct X Rendering (DXR)on this.

Oh. Maybe they could make a CUDA version that would run when a Nvidia card detected. Let’s dream… but at the speed it’s being developed, it seems to be a slow and far wish.

1 Like

Hey, Jimbohalo10!

It’s very intersting and still a little disappointing. I mean, we buy a better GPU to increase speed on our bake and we are limited anyway. My only concern about LGPU is the temperature. Because using it makes my gpu hotspot get 100 C and I’m afraid that it will cause some demage to my gpu. Anyway, thank you for your explanation.

So this is obselete 8 january 2024 at CES 2024

Meanwhile, the GeForce RTX 4070 Ti Super could come equipped with either AD103-275 or AD102-175 GPU featuring 8448 CUDA cores as well as 16 GB of GDDR6X memory. It is rumored that the official recommended retail price is between $799 and $849, which will force graphics board makers to phase out non-Super GeForce RTX 4070 Ti fairly quickly or reduce its price.

@Miguel1900 bet it will work first time on Luoshuang’s GPULightmass and two years later when Microsoft have a DXR (Direct X Raytrace/render) driver for Epic Lightmass. It will probably need SM7, by that time as well :laughing::rofl::rofl:

Hahaha, sure! Fortunately we still have Luoshuang’s one :heart_eyes:

PS: can’t wait to have UE5.4 already released (it’s taking more time than usual, maybe they are waiting to release it in 2024 with the new paid license :smiling_face_with_tear:), with GPULL too!

But the paid license its gonna be for huges companies which use Unreal and never paid for it. Not for small business which use for small archvizz projects. At least that is what I read about it.

hi @Miguel1900 ,
The belief is that licencsing of Unreal will be on the
Twinmotion Licensing and Pricing | Free Community Edition Available - Twinmotion
Policy and when I logged in I got non-commercial status. $0
Educational is $0 as well.
Up to now big companies outside games paid nothing for using UE4/UE5 but from 2024 they will have to pay just as in Twinmotion.
BIG UPDATE HERE for @Miguel1900 Educational NOT affected

see blog We are updating Unreal Engine, Twinmotion, and RealityCapture pricing in late April

We are updating Unreal Engine, Twinmotion, and RealityCapture pricing in late April
We are introducing a new seat-based Unreal Subscription when we release Unreal Engine 5.4. This new pricing of $1,850 per seat will apply to companies generating over $1 million USD in annual gross revenue who are not creating games.

Hi @Jimbohalo10, Thanks for your great work. Loushuang’s GPULightmass is more like CPULightmass, it calculate the GI use GPU insteas of CPU, they use the same method. Because the GPU is more effetive in mutil-calculate,so it will be more quickly. The Epic’ GPULightmass use RayTracing calculate the GI. Is that right ?

hi @Jimbohalo10 and everyone!! and thank you guys for making this amazing mod! although i don’t have any problem whatsoever with baking on ue 5.3.2 and i got pretty amazing results, up untill i added some rect lights and incresed the volumetric lightmap density from default 200 to 150 and i noticed that my build from certain point onwards wasn’t progressing as it use too and it was just too slow and my guessing is that i was runnig out of vram! (i have a rtx2080) and i am aware of the method that we can build without opening the editor with command but the problem is i don’t know how and i’m a little noob when it comes to this stuff. i read the firt post on this page but unfortunately i didn’t understand exactly how and to be honest the command on that post was for ue4 and it’s pretty old. so can someone explain the trick and can we even do it on ue5.3.2? and if we still can please explain how so i can follow up with it, and special thanks for everyone that made this mod possible!!

Hi @aydanyr ,
the rect lights are NOT supported in LGPU . The alternate way is to use emissive as described in post

Hi @BoxCorer .
Epic GPU Lightmass (EGPULM) is a light-baking solution This system of baking lighting into textures is similar to the CPU-based Lightmass Global Illumination system.This system of baking lighting into textures is similar to the CPU-based Lightmass Global Illumination system.
see the document
GPU Lightmass Global Illumination in Unreal Engine | Unreal Engine 5.3 Documentation

@Jimbohalo10 Thanks for your reply :heart_eyes:. I have read the epic help document, So how does LGPU work like? it is same to Epic GPU lightmass? I find Epic GPU Lightmass have very little paramters to control, most in the GPU lightmass Control Panel, but LGPU can use CPU lightmass same control paramter.

Thank you for your respond! that’s weird because i had a couple rect lights before and i had a successful light build with lgpu, however i had a long skylight radiousity before mapping process on swarm status, it was like 6000 seconds and cpu was on full load without any gpu utilization after a while while on the mapping stage gpu took over untill the end with 100 percent utilization alongside the cpu!! when i opened the project they were looking fine! so i suppose that baked only the direc light of the rect light? and also sometimes my light bake with lgpu takes soo much time and it barely even progresses and eventually i just canceled the building, is there something that i’m missing? i’m baking with production and my base lightmass settings are (primaryGISamples: 128 secondaryGISamples:64) world settings: indirect and skylight bounces are also 10 and sometimes i tend to decrease volumetric lightmap detail cell size to something around (30-50) which i couldn’t ever build with that volumetric size it always just gets extremely slow and after a while i just give up and cancel the build! and when that happens my graphics card also gets too cold but with something like 80-100 utilization, vram around 7 to 7.9 gigs (i have a rtx 2080 with 8 gigs of vram). am i really missing on some settings or anything like that? or that my gpu just can’t handle it? also as i said in my first post if there is a workaround to start my build with a command or something so i can save some vram and etc… i would appreciate a lot if you could tell me how to do it so i can follow along.