Giter Site home page Giter Site logo

Comments (11)

walbourn avatar walbourn commented on May 22, 2024

Please build and then run the sdkmeshdump.cpp tool on your sdkmesh and post the results here so I can get a sense of the size of resources you need.

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

Here's what I got back for the model I'm having issues with.

from directxtk12.

walbourn avatar walbourn commented on May 22, 2024

Also, are you calling GraphicsMemory::Commit each rendering frame? It's critical for the memory reclamation.

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

Yeah, I call it at the end of every render. I'm also utilising GraphicsMemory::GarbageCollect in-between loading models to try and help, but it doesn't seem to make much difference.

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

I'm calling DeviceResources::WaitForGpu before GraphicsMemory::GarbageCollect as the function states the GPU must be idled before using for best effects - is this correct?

from directxtk12.

walbourn avatar walbourn commented on May 22, 2024

I think the question is what is your overall memory usage. The LinearAllocator used by GraphicsMemory grows the heap on-demand so it's not a fixed size. That said, it can't grow the heap larger than the amount of memory that your DirectX 12 driver supports for UPLOAD type heaps.

Are you loading a lot of models? Are you using LoadStaticBuffers to convert the UPLOAD VB/IB to DEFAULT? Are you using x64 native or 32-bit?

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

The issue occurs usually when switching between models - I use one large model for each of our environments. When changing environments I unload it, then load the next. They're all of a similar size to the dump I posted. The environments have a few other models loaded within them but they're all pretty small (~3K verts). When loading the models I do call LoadStaticBuffers, I guess this is correct?

from directxtk12.

walbourn avatar walbourn commented on May 22, 2024

Did you close this because you were able to resolve the issue?

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

Utilising GraphicsMemory::GarbageCollect after a call to DeviceResources::WaitForGpu following a reset of model resources did the trick for my runtime model swapping issue. To solve the initial "out of memory" loading issue I simply split my model into two SDKMESH files to load-in which seems to work fine. Up to you if you keep the issue open - it might be worth exploring the problem further as it is repeatable with large individual SDKMESHes.

from directxtk12.

walbourn avatar walbourn commented on May 22, 2024

Thanks. I'll keep an eye out for future problems.

I did add some more debugging output in this commit.

BTW, are you using 32-bit or 64-bit native?

from directxtk12.

MattFiler avatar MattFiler commented on May 22, 2024

Appreciate the help! I'm using 64-bit.

from directxtk12.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.