Git Product home page Git Product logo

Comments (17)

vertver avatar vertver commented on June 11, 2024 1

The AGS SDK doesn't seem to support GPU Heaps, so I think it may only be available on NVIDIA GPUs in D3D11.

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Link to the discussion: #24 (comment)

Actually there is D3D12_HEAP_TYPE_GPU_UPLOAD, what greatly simplifies things.

from nri.

vertver avatar vertver commented on June 11, 2024

Actually there is D3D12_HEAP_TYPE_GPU_UPLOAD, what greatly simplified things.

I also wanted to quote this heap type (some info about this heap type here).

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

D3D12_HEAP_TYPE_GPU_UPLOAD is not available even in the latest Win SDK. Let me understand what Agility SDK is...
P.S. Link in your post is broken...

from nri.

vertver avatar vertver commented on June 11, 2024

P.S. Link in your post is broken...

fixed

what Agility SDK is

This is an optional package for WinSDK for experimental features for runtime and compiler, such as wave matrices or video decoding.

from nri.

vertver avatar vertver commented on June 11, 2024

Also, it might be useful to support Agility SDK because of Enhanced Barriers. What do you think?

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Agility SDK is awful. Instead of adding an ability to download and install D3D SDK update (what MS calls Agility SDK) into a specific folder (like VK SDK, like VS redistributable), they put this burden on users, which have to include it in their apps. This model suits for games, but is worse for NRI-like projects. It seems to me that we will have to either ask to install Agility SDK into a specific folder or just starting redistributing it with NRI, what is just wrong. I will discuss with colleagues how to proceed better...

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Enhanced Barriers. What do you think?

IMO, minimal performance gains in exchange of maximum pain in the ass. But, unfortunately, we should move into this direction... no rush though :) Feel free to create a separate issue for this. E-barriers == VK-style barriers. VK-style barriers are already in NRI, so should not be difficult to migrate, assuming no surprises...

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

A short update - I'm trying to find the best way of linking with Agility SDK. My plan is to get it working today.

from nri.

vertver avatar vertver commented on June 11, 2024

Sounds good. Let me know when you get something going.

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

I compiled NRI/D3D12 with Agility SDK. Here is what I added to the README:

====================================================================

CMAKE OPTIONS

  • NRI_STATIC_LIBRARY - build NRI as a static library (off by default)
  • NRI_BACKEND_VK - enable VULKAN backend (on by default)
  • NRI_BACKEND_D3D11 - enable D3D11 backend (on by default on Windows)
  • NRI_BACKEND_D3D12 - enable D3D12 backend (on by default on Windows)

Vulkan only:

  • NRI_DISABLE_XLIB_SUPPORT - disable Xlib support (off by default)
  • NRI_DISABLE_WAYLAND_SUPPORT - disable Wayland support (off by default)

D3D12 only:

  • NRI_AGILITY_SDK_PATH - path to a directory containing Agility SDK: contents of .nupkg/build/native/ (C:/AgilitySDK by default)
  • NRI_AGILITY_SDK_VERSION - Agility SDK version (611 by default, can be newer)
  • NRI_AGILITY_SDK_DIR - directory where Agility SDK binaries will be copied to relative to CMAKE_RUNTIME_OUTPUT_DIRECTORY (AgilitySDK by default)

AGILITY SDK

Overview and Download sections can be found here.

D3D12 backend requires Agility SDK to get access to most recent D3D12 features. As soon as these features become available in the OS, installation of Agility SDK will be deprecated.

Installation tips:

  • download Agility SDK package
    • set NRI_AGILITY_SDK_VERSION to the version of the package
  • rename .nupkg into .zip
  • copy contents of .nupkg/build/native into NRI_AGILITY_SDK_PATH folder
    • can be located anywhere
  • set NRI_AGILITY_SDK_DIR to a path, where bin folder needs to be copied
    • most likely closer to the executable
  • include auto-generated NRIAgilitySDK.h header in the code of your executable

====================================================================
Does it look acceptable? I made some experiments and based on restrictions of Agility SDK and Windows itself didn't manage to find a better solution.

P.S. Adding ReBAR support now...

from nri.

vertver avatar vertver commented on June 11, 2024

I think this is acceptable. If you're already doing ReBAR support, I'll try to do something with tiled texture support and after that Enhanced Barriers.
P.S. Can you answer my question in #26?

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Realized how bad is the design of Agility SDK:

  • developer mode required for a preview of A-SDK (preview of preview ^_^)
  • manual copying mambo-jumbo because the package is .nupkg
  • various Windows restrictions preventing to create "symbolic links" without Admin rights
  • Agility SDK can't be loaded from "another drive"

As the result, I made Agility SDK an optional feature. At least DEVICE_UPLOAD (aka GPU upload heap) will softly fallback into HOST_UPLOAD if A-SDK is not enabled. Updated README to reflect the changes.

P.S. Answered :)

from nri.

vertver avatar vertver commented on June 11, 2024

At least DEVICE_UPLOAD (aka GPU upload heap) will softly fallback into HOST_UPLOAD if A-SDK is not enabled. Updated README to reflect the changes.

I've thought about this behaviour too, and it seems really reasonable. Also, how about supporting BAR without ReBAR via a separate heap for Vulkan as I showed you before?

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Let me understand how it works in VK. My current understanding is that I just need to find a heap with proper "memory flags". If I'm right, it will work out of the box. Even if ReBAR is disabled, at least NV driver exposes 256 Mb of BAR memory.

from nri.

vertver avatar vertver commented on June 11, 2024

Even if ReBAR is disabled, at least NV driver exposes 256 Mb of BAR memory.

Exactly! You can use this separate heap as upload heap.

from nri.

dzhdanNV avatar dzhdanNV commented on June 11, 2024

Exposed MemoryLocation::DEVICE_UPLOAD in v1.115 with silent fallback to HOST_UPLOAD:

  • VK: DEVICE_BIT is "desired" for DEVICE_UPLOAD memory location
  • D3D12: GPU_UPLOAD is available only if NRI is compiled with enabled Agility SDK support (fallback works in any case)
  • D3D11: no support, HOST_UPLOAD is used

from nri.

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.