TriAxis-Games / RealtimeMeshComponent

Unreal Engine 5 plugin component for rendering runtime generated content.

Home Page:https://rmc.triaxis.games/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intermittent crash due to UE5 DX12 GPU memory bug

connorjak opened this issue · comments

I noticed this wasn't listed as an issue. It's been brought up on Discord a few times. It might be possible there's a workaround. Documenting the exact characteristics of this memory bug and how it interacts with RMC will help both find a workaround and possibly reveal the underlying issue for a PR on UE5.

Please link other mentions of this GPU memory bug on other repos, the forums, UE5 github, etc.

Possibly related message on the RMC discord: https://discord.com/channels/455826886938066986/455872643174891532/1108512794971738192

Why there is an error when I create huge mesh with 1M trianges
Runs and when I exit PIE I get crashreport with this
Assertion failed: TrackedAllocationData.Remove(InAllocation) == 1 [File:D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Adapter.cpp] [Line: 1562]
??
image

	URealtimeMesh* RealtimeMesh = RealtimeMeshComponent->InitializeRealtimeMesh(URealtimeMeshSimple::StaticClass());
	RealtimeMesh->SetupMaterialSlot(0, TEXT("TriMat"), Material);
	URealtimeMeshSimple* RealtimeMeshSimple = (URealtimeMeshSimple*)RealtimeMesh;
	FRealtimeMeshSimpleMeshData MeshData = FRealtimeMeshSimpleMeshData();
	
	LOOP
	
	
	FRealtimeMeshSectionKey StaticSectionKey = RealtimeMeshSimple->CreateMeshSection(
		0,
		FRealtimeMeshSectionConfig(ERealtimeMeshSectionDrawType::Dynamic, 0),
		MeshData,
		false
	);

I just do it in the loop and add 1M triangles via AddBlockTop and when I close PIE I have got a crash without any error logs

If I use smaller number of triangles ~ 200-500k then it doesnt crash

@Koderz Does 993aeb0 directly relate to this issue?

@connorjak Potentially yes, I more just did a RHI validation on it and fixed what came up so while I'm not 100% sure I believe it would be related.

I believe this should be fixed in the latest version! If not feel free to reopen this issue or create a new one!

Thanks,
Koderz