[Daydream] - 4.12 crashing project: Assertion failed when manipulating 3D Widgets

I followed the instructions from:
http://docs.unrealengine.com/latest/INT/Platforms/GoogleVR/QuickStart/index.html

which works fine for a new blank project created in 4.12 however when I imported my project (that works fine in 4.11 for GearVR), I get the following crash at seemingly random positions - however always within approx 10-30secs of starting the app and inserting into my cardboard:

06-05 14:15:39.335: D/UE4(11959): Assertion failed: !IsImmediate() [File:Runtime/RHI/Public/RHICommandList.inl] [Line: 15] 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FDebug::LogAssertFailedMessage(char const*, char const*, int, wchar_t const*, ...) 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FGoogleVRHMD::RenderTexture_RenderThread(FRHICommandListImmediate&, FRHITexture2D*, FRHITexture2D*) const 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FSlateRHIRenderer::DrawWindow_RenderThread(FRHICommandListImmediate&, FSlateRHIRenderer::FViewportInfo const&, FSlateWindowElementList&, bool, bool) 
06-05 14:15:39.335: D/UE4(11959): libUE4.so![Unknown]() 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FNamedTaskThread::ProcessTasksNamedThread(int, bool) 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FNamedTaskThread::ProcessTasksUntilQuit(int) 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!RenderingThreadMain(FEvent*) 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FRenderingThread::Run() 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FRunnableThreadPThread::Run() 
06-05 14:15:39.335: D/UE4(11959): libUE4.so!FRunnableThreadPThread::_ThreadProc(void*) 
06-05 14:15:39.335: D/UE4(11959): libc.so![Unknown]() 
06-05 14:15:39.335: D/UE4(11959): libc.so![Unknown]() 
06-05 14:15:39.335: D/UE4(11959): [2016.06.05-12.15.39:343][-6918240]Assertion failed: Assertion failed: !IsImmediate() [File:Runtime/RHI/Public/RHICommandList.inl] [Line: 15] 
06-05 14:15:39.335: D/UE4(11959): [2016.06.05-12.15.39:344][-6918240]LogWindows: FAndroidMisc::RequestExit(1)

What is causing this crash?

Are you using the experimental 3D widget feature, by chance?

Hi Nick,

Yes I am - they display ok though, but now that you mention it, the crash may occur when I try to change the opacity of an image located within it. I won’t be able to try that out until tonight (European time) - had been really running out of ideas that was causing the crash

That crash is unfortunately due to the 3d widgets, which are experimental because the tools team hasn’t had an opportunity to stabilize them. This issue will be fixed up when they get time to do a pass on those. It’s not VR specific, but VR, because of stereoscopic rendering, usually causes the crash to present sooner, as you’re switching view contexts more often.

That is disappointing and strange that the same project with them works fine on the GearVR :frowning:

I tested it out by removing my 3D widgets and it did indeed work correctly then.

Is there any ETA for fixing the 3D widgets for daydream support? They are just so handy for VR I was always wondering why they aren’t polished off finally (hopefully with VR raytracing support so it’s easier to use them as menus in VR)

A unrelated side note Nick but about my Daydream export in general - I noticed the app runs at a different resolution from GearVR (I don’t change any settings and r.ScreenPercentage is the same for both platforms) but I see the following in the logs:

daydream export: “LogRenderer: Reallocating scene render targets to support 1280 x 720”

gearvr export: “LogRenderer: Reallocating scene render targets to support 2560x1440”

As a result there is a huge difference in performance and of course in looks. Is there a reason why the GoogleVR export is such a low resolution in UE4? Is that a standard res Google are aiming for there?

Thanks in advance for the information and let me know if you’d prefer I created a new answerhub ticket for that.

I too am experiencing this crash when I change the opacity of a texture via animation in a 3D widget. I’m using UE 4.12.2

If this won’t be fixed soon, I will try to remake the UI using Text Render actors, Paper Sprites or static mesh as these haven’t been experiencing any issues.

This should be fixed by cl 3033490, which will be mirrored to github eventually. It is a single line cpp file change.

oh, actually it will take longer to hit github because it was submitted into a branch.

I’ll just describe the change so you can make it locally rather than wait a few weeks.

Engine/Plugins/Runtime/GoogleVR/GoogleVRHMD/Source/GoogleVRHMD/Private/GoogleVRHMDRender.cpp

Near the end of the function ResolvePendingRenderTarget() there is a line:
RHICmdList.Flush();

Change it to:
RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThread);

Thanks JefferyFisher! I’ll be sure to try this out in the next week.

Hi JeffreyFisher - is this fix in 4.13P2 already? I’m noticing another crash now which is slightly different and occurring bit later then this crash but wonder if it’s still related?:

Yes, this fix is in all 4.13 releases. I was able to run a simple test probject on daydream for at least several minutes, and did so a half dozen times after making this fix.

Nice to hear :slight_smile: Any ideas for my followup crash then that is occurring at a point shortly after?

Not commenting there because I have nothing very specific to say. Looks like basically a null pointer, not obvious to me where it comes from. Would have to debug it.