Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for priority based residency #1

Open
bbernhar opened this issue Aug 6, 2021 · 3 comments
Open

Support for priority based residency #1

bbernhar opened this issue Aug 6, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@bbernhar
Copy link
Contributor

bbernhar commented Aug 6, 2021

Uses ID3D12Device1::SetResidencyPriority to manage residency per resource/heap.

Implement and decide if/how this will work with ID3D12Device::[MakeResident|Evict] based residency via gpgmm::d3d12::ResidencySet.

@bbernhar
Copy link
Contributor Author

bbernhar commented Aug 11, 2021

@bjjones, this one would be a good follow-up work item.

@bjjones
Copy link
Contributor

bjjones commented Aug 11, 2021

This was something I experimented with at the time - but the Intel driver I used did not seem to have the functionality. The scheme was pretty simple - instead of MakeResident(), I set priority high. Instead of Evict(), I set priority low.

Something like this would be pretty simple to integrate:

  • Locked heaps are priority MAX
  • heaps scheduled for use are priority HIGH
    • heaps in the LRU (i.e. fit in memory) would remain HIGH even if they aren't scheduled for use.
  • heaps that don't fit into memory and are not scheduled for use are priority LOW

Part of me thinks that heaps that do fit into memory, but are not scheduled for use could be priority NORMAL, however this will require cycles on the CPU to iterate the LRU and I don't know that it would have a worthwhile effect.

@bbernhar
Copy link
Contributor Author

That idea seems pretty reasonable to me.

I envision two modes: 1) to mimic MakeResident/Evict but using priorities and/or 2) means for the developer to override these priorities.

The first mode just sets these default priorities as you suggest (ex. heaps in ResidencySet are HIGH, locked heaps are MAX). The second mode skips that so the developer can provide them instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants