Unity-Technologies / UnityRenderStreaming

Streaming server for Unity
Other
1.31k stars 365 forks source link

[BUG]: renderstreaming boardcast/receiver sample cause unity crash when starting streaming #869

Open flankechen opened 1 year ago

flankechen commented 1 year ago

Package version

3.1.0-exp.5

Environment

* OS: ubuntu18.04
* driver version : 470.141.03, CUDA version 11.4 
* GPU:Tesla T4 GPU * 4
* Unity version: unity2020.3.41f1
* WebRTC: 3.0.0-pre.4
* Graphics API: auto
* Browser: chrome 110.0.5481.77(officual build)(64bit)

Steps To Reproduce

1.in a blank new unity project, install renderstreaming package and import samples. 2.download and launch the web application like: sudo ./webserver -w -p 88 3.open chrome and goto this page, the web page looks normal. 4.in unity, open renderstreaming broadcast sample scene, in RenderStreaming script, set it to websocket and ws://localhost:88 image 5.in unity, click play and run, looks ok and logs showing WS connected. image 6.go to chrome the webpage and goto receiver sample page. 7.click play and start to streaming

Current Behavior

result: unity crash immediately, some last log looks like: image

Expected Behavior

expected: unity runs correctly and start streaming to the webpage.

Anything else?

Any idea or Anywhere to check the unity crash log ? a bug has been reported and uploaded. Thanks

karasusan commented 1 year ago

Can you check what the graphics driver is installed? I assume that the issue relates the graphics driver for Linux.

flankechen commented 1 year ago

@karasusan it's a driver version : 470.141.03, CUDA version 11.4 Tesla T4 GPU * 4

karasusan commented 1 year ago

@flankechen It looks no problem. How about Unity player log?

flankechen commented 1 year ago

@karasusan here is some logs, and BTW, a unity bug report is uploaded https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-31844 https://issuetracker.unity3d.com/issues/linux-render-streaming-crash-on-getrendereventfunc-when-connecting-receiver-sample-to-broadcast-sample

First lines of the stack trace:

11 0x007f18daf645fe in GetRenderEventFunc

12 0x0055a3949a9401 in RenderingCommandBuffer::ExecuteCommandBufferWithState(ShaderPassContext&, RenderNodeQueue&, RenderingCommandBufferState*, unsigned int, ComputeQueueType) const

13 0x0055a3949a7ac4 in RenderingCommandBuffer::ExecuteCommandBuffer(ShaderPassContext&, RenderNodeQueue&, unsigned int, dynamic_array<std::pair<ShaderLab::FastPropertyName, RenderTexture*>, 0ul>, ComputeQueueType, RenderTexture) const

14 0x0055a39491fbe0 in ExecuteCommandBufferFromScriptImpl(RenderingCommandBuffer, ComputeQueueType, ScriptingExceptionPtr)

15 0x0055a394255ef6 in Graphics_CUSTOM_ExecuteCommandBuffer(ScriptingBackendNativeObjectPtrOpaque*)

Obtained 32 stack frames.

0 0x007fc743eae980 in funlockfile

1 0x007fc743ae9e87 in gsignal

2 0x007fc743aeb7f1 in abort

3 0x007fc74373b0a9 in __cxa_throw_bad_array_new_length

4 0x007fc743746506 in std::rethrow_exception(std::__exception_ptr::exception_ptr)

5 0x007fc743746571 in std::terminate()

6 0x007fc743746849 in __cxa_rethrow

7 0x007fc5ba78abb0 in std::vector<char const, std::allocator<char const> >::insert(__gnu_cxx::__normal_iterator<char const const, std::vector<char const, std::allocator<char const> > >, char const* const&)

8 0x007fc5ba77de43 in std::vector<unsigned char, std::allocator >::_M_default_append(unsigned long)

9 0x007fc5ba77d803 in std::vector<unsigned char, std::allocator >::_M_default_append(unsigned long)

10 0x007fc5ba77d533 in std::vector<unsigned char, std::allocator >::_M_default_append(unsigned long)

11 0x007fc5ba7635fe in GetRenderEventFunc

12 0x00562eebcc8390 in RenderingCommandBuffer::ExecuteCommandBufferWithState(ShaderPassContext&, RenderNodeQueue&, RenderingCommandBufferState*, unsigned int, ComputeQueueType) const

13 0x00562eebcc67a4 in RenderingCommandBuffer::ExecuteCommandBuffer(ShaderPassContext&, RenderNodeQueue&, unsigned int, dynamic_array<std::pair<ShaderLab::FastPropertyName, RenderTexture>, 0ul>, ComputeQueueType, RenderTexture*) const

14 0x00562eebc3ed00 in ExecuteCommandBufferFromScriptImpl(RenderingCommandBuffer, ComputeQueueType, ScriptingExceptionPtr)

15 0x00562eeb57fe76 in Graphics_CUSTOM_ExecuteCommandBuffer(ScriptingBackendNativeObjectPtrOpaque*)

16 0x00000041034253 in (wrapper managed-to-native) UnityEngine.Graphics:ExecuteCommandBuffer (UnityEngine.Rendering.CommandBuffer)

17 0x000000410333c4 in Unity.WebRTC.VideoStreamTrack:UpdateSendTexture ()

18 0x00000040f004af in UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

19 0x007fc44806f228 in mono_get_runtime_build_info

20 0x007fc44820df8e in mono_runtime_invoke

21 0x007fc44820ded8 in mono_runtime_invoke

22 0x00562eec1718e3 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)

23 0x00562eec14f9f7 in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)

24 0x00562eec10caf7 in Coroutine::InvokeMoveNext(ScriptingExceptionPtr*)

25 0x00562eec10c2ad in Coroutine::Run(bool*)

26 0x00562eebb9dba4 in DelayedCallManager::Update(int)

27 0x00562eebdccafd in PlayerSendFrameComplete()

28 0x00562eecc51550 in RepaintController::RenderPlayModeViewCameras(RenderTexture*, int, Vector2f, bool, bool)

29 0x00562eecee4fb5 in EditorGUIUtility::RenderPlayModeViewCamerasInternal(RenderTexture*, int, Vector2f, bool, bool)

30 0x00562eeb877f9d in EditorGUIUtility_CUSTOM_RenderPlayModeViewCamerasInternal_Injected(ScriptingBackendNativeObjectPtrOpaque*, int, Vector2f const&, unsigned char, unsigned char)

31 0x0000004176332f in (wrapper managed-to-native) UnityEditor.EditorGUIUtility:RenderPlayModeViewCamerasInternal_Injected (UnityEngine.RenderTexture,int,UnityEngine.Vector2&,bool,bool)

eaphone commented 1 year ago

which platform are you using? you can not run webgl at unity editor with this project now.

flankechen commented 1 year ago

@eaphone hi, I am runing this on standalone linux platform setup. I know it's no webgl. the stange thing is, some desektop ubuntu18.04 runs well with this sample. this server environment fails. I notice other guys report server environment runs but not the docker environment as well

kannan-xiao4 commented 1 year ago

@flankechen I'm having a problem that looks the same in my environment, so I'll check. Just in case, is it also happening in the WebRTC sample?

kannan-xiao4 commented 1 year ago

memo: WRS-459