Clicking Play in PIE will occupy all video memory and crash

My project has been crashing since today. When I click Play in PIE, it will quickly use up my 20G dedicated GPU memory and 31GB shared GPU memory. I have been troubleshooting the cause, and then I opened the Render Resource Viewer, which showed that the video memory was occupied by about 12G. Later, I opened Visual Studio and ran the engine in debug mode, and set the breakpoint at the crashing line of code. Then I confirmed that the engine crashed when trying to load LandscapeStreamingProxy by constantly entering different Call Stack. I searched Google for a long time, and no one had the same problem as me. Can anyone give tips?

To get a useful reading from the resource viewer, you need to restart the edtior and then open the viewer directly on the level that’s causing the problem. Otherwise it just shows you the total of everything that’s happened in the editor so far.

Ideally, make the project default level either empty, or the one you’re trying to inspect.

The Editor Startup Map is this level. I have tried many things (such as deleting the RVT code in the material, deleting some material layers), but I can’t get it to work properly, and I have restarted the engine over and over again.

1 Like

But what readings do you get from the viewer on first opening the level? As above?

image

Having said that, it is textures that are killing your GPU.

Are you using 4k and 8k? You’ll find that 2K is fine for everything in 95% of cases. You can set the LOD bias of the textures to 1 for 4K and 2 for 8k.

You can try it dynamically with a console command

r.MipMapLODBias 1

But that will just set everything one notch down…

You might also find it’s the sheer number of resources you’re using in one level. I checked out the resource viewer for a level of mine that’s just starting to push things a bit ( for my target ), and I have

image

So, your total assets in use are 16 times greater than mine.

This is the data when it was just started.

There are indeed a lot of 4K textures, about 200 in total (since Base Color, Normal, and Roughness are usually used in one material, there are about 60 assets using 4K textures, half of which are NPC skins). I haven’t optimized the texture size of the assets yet, and originally planned to adjust it uniformly during the polishing stage.

1 Like

Give the console command a go… :wink:

I think I have found the reason. When I was about to abandon the old project, create a new one and move everything over, I found a line in DefaultEngine.ini with r.VT.TileSize=2048 (there was a clue pointing to VirtualTexture when debugging the source code before). When I deleted this line, everything was normal. To make sure it was this line that caused the problem, I tried to add it back and tested it again, and the engine crashed again.
This may be because I accidentally changed the wrong place when I modified the project configuration.
Anyway, thank you for your help

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.