pelicanmapping / rocky

3D Geospatial SDK (C++17 / Vulkan / VSG)
MIT License
91 stars 15 forks source link

random crash in rocky while zooming and panning #19

Closed keince closed 7 months ago

keince commented 10 months ago

While running rocky, I'm noticing a random crash while panning around on the Earth (see attached image below on details).

I'm seeing this running the rdemo.exe and rengine.exe apps. It appears to happen at different times during execution but it happens regularly at the same location in the code (vsg).

My environment... OS: Windows 10 IDE: Visual Studio 2022 Configuration: RelWithDebInfo Platform: x64

RockyCrashCapture

keince commented 10 months ago

Just a follow-up to my previous post,..

I'm noticing that the process memory (in the diagnostic tools) steadily increases as I move around until it reaches 10.1+ Gb. It is at this point that the crash occurs.

As an experiment, I changed the resourceHints->numDescriptorSets on line 193 and the value on line 195 in rengine.cpp from 1024 to 2048. It pushed off the crash until the process memory reached ~14.5 Gb and then it crashed.

It's like paging memory isn't being released somewhere...

gwaldron commented 10 months ago

Yes. I have noticed the same thing, and it seems to be a function of the pre-allocation of pools in ResourceHints.

In rengine.cpp we are using those resource hints and there's a big memory leak. In rdemo (the code is actually in Application.cpp line ~564) however we're limiting the numDescriptorSets to 1, and there problem doesn't exist.

I am not smart enough about the guts of VSG (yet?) to know what's up, so I appreciate the experimentation and sharing of knowledge :)

keince commented 10 months ago

Thanks for the feedback Glenn.

For the record, the crash still occurs with rdemo.exe like the other applications.

Looking at my version, it has resourceHints->numDescriptorSets = 64; for line 564.

I will do some further research and investigation on the matter on my end to try and help...

gwaldron commented 10 months ago

Grab the latest (with numDescriptorSets = 1) and let me know if you still se the problem.

keince commented 10 months ago

Okay.

I did a pull of the rocky repo.

Do I need to rerun the bootstrap-vcpkg.bat file to update?

gwaldron commented 10 months ago

Probably not, but I would definitely re-run cmake on your build folder.

keince commented 10 months ago

I was finally able to run the rsimple.exe application with the aforementioned changes to the numDescriptorSets and the crash has not happened yet.

However, now I'm seeing something different. It appears that paging stalls periodically so that the higher LODs don't page in. I've attached a picture showing the problem. RockyPagingCapture

gwaldron commented 10 months ago

Can you give me the viewpoint? In rdemo, open Camera->Viewpoints and take a screenshot.

keince commented 10 months ago

Here's a capture around the same area with viewpoint displayed. It might be the source imagery for the tile but I don't see this in osgEarth using ReadyMap...

RockyPagingCapture2

keince commented 10 months ago

Glenn,

Not sure if this is related but I'm noticing that rengine.exe won't render the ReadyMap tiles with the latest git pull of rocky. I just see an orange globe.

Do you see this as well?

I debugged into the rengine.cpp and it appears to be loading the imagery and elevation layers okay.

I'm able to run rdemo.exe and rsimple.exe and see the ReadyMap stuff fine so it's not a network problem on my end.

Shayne

On 10/30/2023 2:20 PM MDT Glenn @.***> wrote:

Can you give me the viewpoint? In rdemo, open Camera->Viewpoints and take a screenshot.

— Reply to this email directly, view it on GitHub https://github.com/pelicanmapping/rocky/issues/19#issuecomment-1785971682, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATC464PNQKISEPCLAYWUCHLYCADXFAVCNFSM6AAAAAA6RWAB3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBVHE3TCNRYGI. You are receiving this because you authored the thread.Message ID: @.***>

gwaldron commented 10 months ago

It's just missing data on the server. (This is osgEarth, Rocky, and ReadyMap console from left to right)

image
gwaldron commented 10 months ago

As for rengine, I pushed a quick fix for that -- I would stick to rdemo for the most part since that's the app that gets the most attention. I do not spend as much time keeping the other 2 up to date :)