🚀 Critical Update Jan/2026

MT5 Build 5572: ONNX with CUDA GPU — 10x Faster Inference

By Dan Machado · 8 min read

On January 29, 2026, MetaQuotes released MT5 Build 5572, and anyone running AI in Expert Advisors needs to update urgently. The changes go beyond cosmetics: with ONNX CUDA GPU support you get a 5x to 15x speedup on LSTM and Transformer models, and old code using ONNX_DEBUG_LOGS may stop working.

What Changed in ONNX CUDA GPU Support — Executive Summary

  1. Official CUDA GPU support — ONNX inference can now run on an NVIDIA card
  2. Redesigned logging systemONNX_DEBUG_LOGS deprecated, new ONNX_LOGLEVEL_* flags
  3. On-demand loading — the ONNX library only loads on first use
  4. Automatic updates — the ONNX library updates itself with no manual work
  5. Blend2D engine — modernized chart rendering

Supported GPUs

Architecture Compatible GPUs Expected speedup
Turing (min.) GTX 1660, RTX 2060, 2070, 2080, T4, Quadro RTX 3-8x
Ampere RTX 3060, 3070, 3080, 3090, A100 5-12x
Ada Lovelace RTX 4060, 4070, 4080, 4090 8-15x

Older cards (GTX 10-series or earlier) are NOT supported. NVIDIA drivers must be up to date — version 537+ is recommended on Windows.

How to Enable CUDA in MT5

  1. Update MT5 to Build 5572 or later
  2. Update your NVIDIA drivers (CUDA Runtime 12+)
  3. Open MT5 → Tools → Options → Expert Advisors
  4. Check ‘Allow CUDA usage’
  5. For multi-GPU systems: specify the device with ONNX_GPU_DEVICE_N (N = 0, 1, 2…)

Migrating Old Code (Deprecated → New)

If you have old EAs using ONNX_DEBUG_LOGS, you need to migrate. The old flag may still work but will generate warnings and will be removed in future builds.

// ❌ BEFORE (Build 5571 and earlier)
long handle = OnnxCreate("model.onnx", ONNX_DEBUG_LOGS);

// ✅ AFTER (Build 5572+) - choose the verbosity level
long handle = OnnxCreate("model.onnx", ONNX_LOGLEVEL_WARNING);
// Other options:
// ONNX_LOGLEVEL_VERBOSE  - everything
// ONNX_LOGLEVEL_INFO     - info + warning + error + fatal
// ONNX_LOGLEVEL_WARNING  - warning + error + fatal (recommended)
// ONNX_LOGLEVEL_ERROR    - error + fatal
// ONNX_LOGLEVEL_FATAL    - fatal errors only

// To use CUDA GPU:
long handle = OnnxCreate("model.onnx", ONNX_GPU_DEVICE_N);

Real-World Benchmark — LSTM in Production

I tested the same LSTM model (2 layers, hidden 64, ~3 MB) with 1,000 inferences on CPU vs an RTX 3060 GPU:

// Model: LSTM 2-layer, hidden 64, sequence length 30
// Dataset: 1000 consecutive inferences
// Hardware: i7-12700K + RTX 3060 12GB

// Build 5571 (CPU only):
//   Total time: 4.2 seconds
//   Average latency: 4.2 ms/inference

// Build 5572 (GPU CUDA):
//   Total time: 0.6 seconds
//   Average latency: 0.6 ms/inference
//   🚀 Speedup: 7x

When Is CUDA Worth It?

✅ Worth it

• LSTM or GRU with hidden ≥ 32
• 1D CNN with 2+ conv layers
• Transformer (any)
• Models > 5 MB
• Multi-asset strategies (several EAs running simultaneously)
• Scalping on HFV indices (latency-critical)

⚠️ Not worth it

• Random Forest (already < 1ms on CPU)
• Small XGBoost (< 100 trees)
• Models < 1 MB
• VPS without a dedicated GPU
• Occasional single-trade EAs

CUDA Troubleshooting

  • Error 5807 — CUDA not available: outdated NVIDIA driver or unsupported card
  • Performance worse than CPU: the model is too small — GPU transfer overhead isn’t worth it
  • ‘Out of memory’: reduce batch size or simplify the model
  • Different results on CPU vs GPU: tiny floating-point differences are expected (GPU FP32 vs CPU FP64)
  • EA freezing after a while: always call OnnxRelease() in OnDeinit()

Next Steps

If you already have EAs running with ONNX, update today. The 5 minutes of migration work are worth the performance gain. If you’re starting from scratch, set up CUDA from day zero — there’s no reason to run on CPU when GPU is free (you already own it).

🚀 To test EAs with ONNX, get a free Deriv MT5 demo ($10,000 virtual):

Open a Deriv MT5 Demo →

DM

Dan Machado

Founder, IA Trader Pro · Specialist in AI applied to trading

⚠️ Disclaimer: Educational content, not investment advice. Trading involves substantial risk. AI models do not guarantee profit. Always test on demo before trading with real capital. Article contains a Deriv affiliate link.

Similar Posts