# How can I run Learning Agents inference on GPU? Is it possible to switch the NNE runtime provider through Blueprints, or does this require a C++ implementation? 

**URL:** <https://forums.unrealengine.com/t/how-can-i-run-learning-agents-inference-on-gpu-is-it-possible-to-switch-the-nne-runtime-provider-through-blueprints-or-does-this-require-a-c-implementation/2651207>\
**Category:** AI\
**Tags:** unreal-engine, Learning-Agents, question\
**Created:** [August 26, 2025, 7:38pm UTC](https://forums.unrealengine.com/t/how-can-i-run-learning-agents-inference-on-gpu-is-it-possible-to-switch-the-nne-runtime-provider-through-blueprints-or-does-this-require-a-c-implementation/2651207 "2025-08-26T19:38:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritzdzire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ritzdzire](https://forums.unrealengine.com/u/ritzdzire)\
**Post date:** [August 26, 2025, 7:38pm UTC](https://forums.unrealengine.com/t/how-can-i-run-learning-agents-inference-on-gpu-is-it-possible-to-switch-the-nne-runtime-provider-through-blueprints-or-does-this-require-a-c-implementation/2651207/1 "2025-08-26T19:38:23Z")

</div>

How can I run Learning Agents inference on GPU? Is it possible to switch the NNE runtime provider through Blueprints, or does this require a C++ implementation?

---

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [August 27, 2025, 2:02am UTC](https://forums.unrealengine.com/t/how-can-i-run-learning-agents-inference-on-gpu-is-it-possible-to-switch-the-nne-runtime-provider-through-blueprints-or-does-this-require-a-c-implementation/2651207/2 "2025-08-27T02:02:10Z")

</div>

You can’t very easily. Inference has to be done on the CPU at this time.

---

<div class="post-metadata">

**Author:** ![ritzdzire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ritzdzire](https://forums.unrealengine.com/u/ritzdzire)\
**Post date:** [August 31, 2025, 8:28pm UTC](https://forums.unrealengine.com/t/how-can-i-run-learning-agents-inference-on-gpu-is-it-possible-to-switch-the-nne-runtime-provider-through-blueprints-or-does-this-require-a-c-implementation/2651207/3 "2025-08-31T20:28:43Z")

</div>

Thanks Brendan.  
I thought of giving it a try and have made the required changes in **LearningNeuralNetwork.cpp**. However, I’m getting the following error during inference:  
[2025.08.31-20.08.20:604][400]LogNNERuntimeORT: Error: ONNX Runtime error 7: Failed to load model because protobuf parsing failed.

The error seems to originate from:  
CreateOrtSessionFromArray() called from  
ModelInstances\_GPU.Emplace(InModel.CreateModelInstanceGPU());  
inside  
void FNeuralNetworkInference::ReloadModelInstances(NNE::IModelGPU& InModel, const int32 InInputSize, const int32 InOutputSize) {}  
which I created for the GPU model.

Since I am loading the same (CPU) model with ModelData-\>Init(TEXT(“onnx”), FileData); modified onnx instead of ubnne. I assume this error is expected.

Do you think saving the model in the correct format during training should fix this? If yes, can you guide me little. I’m not concerned about performance for now.
