-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Rive Flutter Windows GPU Crash Issue
Description
On Windows (x64), using the Rive Flutter runtime rive: 0.14.0, the app crashes in Release on machines with dedicated GPUs (but not on machines with integrated GPUs) when rendering .riv animations with Factory.flutter. The crash manifests as native heap corruption (0xC0000374) and access violations.
Rive docs mention the latest runtime is published as 0.14.0-dev.x and recommend using the latest dev for newest fixes/features. Changelog notes include prior Windows crash fixes (e.g., issue #529) and Windows debugging symbol improvements. rive_native changelog also references "Fixed a crash when using the Flutter renderer" and allowing native to work even if the Rive Renderer context doesn't initialize.
Steps To Reproduce
Steps to reproduce the behavior:
- Create a new Flutter project and enable Windows desktop.
- Add
rive: 0.14.0topubspec.yaml. - Add any
.rivfile toassets/and include it inpubspec.yaml. - Run on a Windows machine with a dedicated GPU (NVIDIA/AMD) in Release.
- Render the
.rivusingFactory.flutter(example below). - App eventually crashes with native heap corruption (0xC0000374) / access violations. On integrated GPU machines, it does not reproduce.
Minimal code:
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
void main() {
runApp(const MaterialApp(home: Scaffold(body: Center(child: Demo()))));
}
class Demo extends StatelessWidget {
const Demo({super.key});
@override
Widget build(BuildContext context) {
return RiveAnimation.asset(
'assets/sample.riv',
fit: BoxFit.contain,
factory: Factory.flutter,
);
}
}Expected behavior
Factory.flutter should render reliably on Windows (including on dedicated GPU machines) without native heap corruption crashes.
Screenshots
N/A (crash / blank output). Can provide screen recording if needed.
Device & Versions
Device: Windows desktop (x64)
OS: Windows 11 (ntdll.dll 10.0.26100.6899; seems like 24H2)
GPU:
- ✅ Works: Integrated GPU machines (e.g., Intel iGPU)
- ❌ Crashes: Dedicated GPU machines (e.g., NVIDIA/AMD dGPU)
(Will add exact GPU model(s) + driver versions)
Testing on: Nvidia RTX 3050
Flutter Version: 3.35.7
Rive Version: rive: 0.14.0 (pub.dev)
Additional context
With --no-enable-impeller, crash presents as:
- Faulting module:
ntdll.dll - Exception code:
0xc0000374(heap corruption)
WinDbg stack (k) shows heap corruption detected during RtlFreeHeap, with frames involving Flutter's GPU texture path and rive_native:
flutter_windows!InternalFlutterGpu_Texture_AsImage
rive_native!enableFallbackFonts+... (symbol name; project has no text in the .riv files)
Earlier also observed:
Exception thrown at ... (rive_native.dll) ... 0xC0000005: Access violation reading location 0x00000000FFFFFFF7
on dGPU machines.
If helpful, I can attach the full crash dump + WinDbg output.