Course: Neural Network Engine (NNE)

Hi everyone, I am working with mnist-8 model in the guide and I got the following runtimes to work, for context, I am on a windows machine with an Intel CPU and a Nvidia GPU running Unreal Engine 5.3:

NNERuntimeORTCuda (strictly requires CUDA 11.4 and CUDNN 8.8.2.26)
NNERuntimeORTDml (Works with no extra requirements)
NNERuntimeOrtCpu (Works with no extra requirements)

for NNERuntimeRDGHlsl → I could not even create a Model, I got errors that some layers are not supported, like the MaxPooling Layer for example, which I assume that requires creating those custom layers using HLSL some where in the code

I am trying to get NNERuntimeRDGDml to work and I think I am very close, here are the steps:

  1. Load Model Manual, Automatic or Lazy → works
  2. Create RDG Model → works
  3. Create RDG Model Instance → works
  4. set inputs and outputs → works
  5. Create input and output RDG Buffers on the GPU → works
  6. create input and output bindings → works
  7. Enqueue model, input bindings, output binding to the RDG → works
  8. Execute the RDG → works and then the editor crashes

I checked the logs and the last thing printed before the crash is “Graph Builder Executed” which I print right after GraphBuilder.execute() so I assume this means inference is running on the render dependency graph successfully
also the reason for the crash is a Memory access violation, so may be after or during graph execution the engine is trying to access a null pointer or something, trying to figure it out

There are 3 functions in my code (see below)

  1. void NNERDG::CreateModelRDG() → the main function where steps 1 to 8 are executed

  2. void NNERDG::CreateRDGBuffers(int32 InputSize, int32 OutputSize) → for step 5

  3. void NNERDG::RunInferenceRDG(TSharedPtrUE::NNE::IModelInstanceRDG ModelInstanceRDG, TArray NNEInputTensorArrayBuffer) → for steps 6,7 and 8

I need help in

  1. confirming that the input and output data setup and bindings are correct in steps 4, 5 and 6
  2. confirm that step 7 is done correctly as well
  3. Why the editor is crashing after GraphBuilder is executed

Thank you

RDGModel.cpp (9.1 KB)