Description

When the RHI thread is enabled (with or without parallel-execution) for Metal it isn't currently possible to run "profilegpu" because the GPU timestamp emulation code isn't multi-thread safe and promptly asserts. Without an official timestamp API this will remain a problem.

Steps to Reproduce

1. Build UE4/SCW
2. Run any project in -game.
3. Use the in-game command line (~) and enter: profilegpu

Callstack
Thread 9 Crashed:: TaskGraphThreadNP 0
0   UE4Editor-Core.dylib          	0x0000000100dcb50b FGenericPlatformMisc::RaiseException(unsigned int) + 43 (GenericPlatformMisc.cpp:307)
1   UE4Editor-Core.dylib          	0x0000000100fa5d36 FOutputDeviceMacError::Serialize(wchar_t const*, ELogVerbosity::Type, FName const&) + 614 (MacPlatformOutputDevices.cpp:93)
2   UE4Editor-Core.dylib          	0x0000000101023727 FOutputDevice::Logf(wchar_t const*, ...) + 455 (OutputDevice.cpp:94)
3   UE4Editor-Core.dylib          	0x000000010101ee9b FDebug::AssertFailed(char const*, char const*, int, wchar_t const*, ...) + 347 (ContainerAllocationPolicies.h:484)
4   UE4Editor-RHI.dylib           	0x0000000107ca18ec FGPUProfiler::PushEvent(wchar_t const*, FColor) + 348 (GPUProfiler.cpp:552)
5   UE4Editor-MetalRHI.dylib      	0x00000001344e06a0 FMetalRHICommandContext::RHIPushEvent(wchar_t const*, FColor) + 32 (MetalRHI.cpp:580)
6   UE4Editor-RHI.dylib           	0x0000000107ca847c FRHICommandListExecutor::ExecuteInner_DoExecute(FRHICommandListBase&) + 1916 (RHICommandList.cpp:254)
7   UE4Editor-RHI.dylib           	0x0000000107caac24 FRHICommandListExecutor::ExecuteInner(FRHICommandListBase&) + 7716 (RHICommandList.cpp:455)
8   UE4Editor-RHI.dylib           	0x0000000107cabaea FRHICommandListExecutor::ExecuteList(FRHICommandListBase&) + 2282 (Stats2.h:1537)
9   UE4Editor-RHI.dylib           	0x0000000107cae2bf FRHICommandListBase::~FRHICommandListBase() + 639 (RHICommandList.cpp:696)
10  UE4Editor-RHI.dylib           	0x0000000107cea8a5 FParallelTranslateCommandList::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) + 1221 (RHICommandList.cpp:1665)
11  UE4Editor-RHI.dylib           	0x0000000107ce9ef7 TGraphTask<FParallelTranslateCommandList>::ExecuteTask(TArray<FBaseGraphTask*, FDefaultAllocator>&, ENamedThreads::Type) + 535 (Stats2.h:1537)
12  UE4Editor-Core.dylib          	0x0000000100e09251 FTaskThreadAnyThread::ProcessTasks() + 1249 (TaskGraph.cpp:259)
13  UE4Editor-Core.dylib          	0x0000000100e080bd FTaskThreadAnyThread::ProcessTasksUntilQuit(int) + 381 (GenericPlatformProcess.cpp:504)
14  UE4Editor-Core.dylib          	0x0000000100e07d5b FTaskThreadBase::Run() + 331 (TaskGraph.cpp:621)
15  UE4Editor-Core.dylib          	0x0000000100e5b428 FRunnableThreadPThread::Run() + 376 (PThreadRunnableThread.cpp:26)
16  UE4Editor-Core.dylib          	0x0000000100e21011 FRunnableThreadPThread::_ThreadProc(void*) + 353 (PThreadRunnableThread.h:172)
17  libsystem_pthread.dylib       	0x00007fff8727b99d _pthread_body + 131
18  libsystem_pthread.dylib       	0x00007fff8727b91a _pthread_start + 168
19  libsystem_pthread.dylib       	0x00007fff87279351 thread_start + 13

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

3
Login to Vote

Fixed
ComponentUE - Graphics Features
Affects Versions4.134.14
Target Fix4.17
Fix Commit3432366
Main Commit3461201
CreatedSep 14, 2016
ResolvedMay 10, 2017
UpdatedJun 5, 2017
View Jira Issue