FirstPersonKSP / Kerbal-VR

An add-on for Kerbal Space Program (KSP) to enable virtual reality.
Other
95 stars 5 forks source link

Game crashes when using external cameras #170

Closed JonnyOThan closed 1 year ago

JonnyOThan commented 2 years ago

Not right away though. Maybe some kind of graphics resource leak?

This has definitely happened with scatterer uninstalled, so that's not likely to be the culprit.

One thread crashes here:

     [Inline Frame] UnityPlayer.dll!atomic_compare_exchange_strong_explicit(volatile atomic_word2 *) Line 324    C++
     [Inline Frame] UnityPlayer.dll!atomic_load_explicit(const volatile atomic_word2 *) Line 349    C++
     UnityPlayer.dll!AtomicList::Load(__int64 & tag) Line 1142    C++
     UnityPlayer.dll!JobQueue::WaitForJobGroupID(JobGroupID groupID, JobQueue::JobQueueWorkStealMode workStealMode) Line 1568    C++
     UnityPlayer.dll!CompleteFenceInternal(JobFence & fence, WorkStealMode workStealMode) Line 32    C++
     [Inline Frame] UnityPlayer.dll!SyncFence(JobFence &) Line 289    C++
>    UnityPlayer.dll!GeometryJobTasks::EndGeometryJobFrame(GfxDevice & device) Line 63    C++
     UnityPlayer.dll!GfxDeviceWorker::RunCommand(ThreadedStreamBuffer & stream) Line 775    C++
     [Inline Frame] UnityPlayer.dll!ProcessGfxCommands(GfxDeviceWorker &) Line 161    C++
     UnityPlayer.dll!GfxDeviceWorker::RunExt(ThreadedStreamBuffer & stream) Line 423    C++
     [Inline Frame] UnityPlayer.dll!GfxDeviceWorker::Run() Line 407    C++
     UnityPlayer.dll!GfxDeviceWorker::RunGfxDeviceWorker(void * data) Line 386    C++
     UnityPlayer.dll!Thread::RunThreadWrapper(void * ptr) Line 78    C++

And the main thread is here:

     KernelBase.dll!WaitForSingleObjectEx()    Unknown
     [Inline Frame] UnityPlayer.dll!WinApi::Baselib_SystemSemaphore_Acquire(Baselib_SystemSemaphore_Handle) Line 29    C++
     UnityPlayer.dll!Baselib_SystemSemaphore_Acquire(Baselib_SystemSemaphore_Handle semaphore) Line 14    C++
     [Inline Frame] UnityPlayer.dll!GfxPlatformSemaphore::WaitForSignal(unsigned int) Line 35    C++
     [Inline Frame] UnityPlayer.dll!GfxDeviceWorker::WaitForEvent(GfxDeviceWorker::EventType) Line 355    C++
>    UnityPlayer.dll!GfxDeviceWorker::WaitOnCPUFence(unsigned int fence) Line 367    C++
     UnityPlayer.dll!GfxDeviceClient::WaitOnCPUFence(unsigned int fence) Line 3152    C++
     UnityPlayer.dll!VRDevice::BeforeRendering() Line 902    C++
     [Inline Frame] UnityPlayer.dll!CallbackInfoBase<void (__cdecl*)(void),void (__cdecl*)(void const *)>::Invoke() Line 70    C++
     UnityPlayer.dll!CallbackArray::Invoke() Line 331    C++
     [Inline Frame] UnityPlayer.dll!XREngineCallbacks_BeginFrame() Line 52    C++
     UnityPlayer.dll!`XREngineCallbacks::XREngineCallbacks'::`2'::FrameEventsXRBeginFrameRegistrator::Forward() Line 73    C++
     [Inline Frame] UnityPlayer.dll!PlayerSendFrameStarted() Line 948    C++
     UnityPlayer.dll!`InitPlayerLoopCallbacks'::`2'::PostLateUpdatePlayerSendFrameStartedRegistrator::Forward() Line 1268    C++
     UnityPlayer.dll!ExecutePlayerLoop(NativePlayerLoopSystem * system) Line 352    C++
     UnityPlayer.dll!ExecutePlayerLoop(NativePlayerLoopSystem * system) Line 369    C++
     UnityPlayer.dll!PlayerLoop() Line 441    C++
JonnyOThan commented 2 years ago

Last night I flew an entire mun rescue mission with an external camera active and did not have any trouble. The command pod was the mk2, and it was a pretty simple ship.

Then I launched a large duna mission with the mk1-3 DE_VR IVA and a single camera active - and it crashed nearly immediately after launch. I wonder if the ship complexity or specific IVAs are the culprit.

Of course the theory that it's caused by a race condition would mean that it might be very sensitive to workloads on the CPU and GPU.

Alexthebug9 commented 1 year ago

same camera thing just happened to me

JonnyOThan commented 1 year ago

This has been fixed in RPM