I’ve written a program for my research that does robotics simulations. It causes video corruption, and I’m not sure why that might be.
The video corruption itself only affects my external monitor, never my laptop’s built-in monitor. It consists of horizontal bars of distortion that arise non-deterministically after some minutes. More bars appear as minutes pass and the program keeps running. They go away when I turn the monitor off and on again.
I know almost nothing about how video memory works. In fact, in my naivety, I kind of thought it would be impossible for a non-privileged user program to corrupt the video. So I’m not sure what components I should even be thinking about. Below are some details. It’s not strictly necessary that I fix this, so I can’t follow too deep a rabbit hole, but I would appreciate any tips on how to begin thinking about what sort of animal this is.
- Program: C++, compiled with GCC 11.2.1. Uses SDL2 (2.0.14) to display bitmaps in a window every few seconds. Also uses the Eigen library (3.3.9) for matrix math. The corruption only seems to happen (though I’m not certain yet) when both libraries are being actively used. Valgrind shows no memory errors anywhere. It shows some memory leaks in the SDL2 internals, which googling suggests may be normal.
- OS: Fedora 34 Workstation with GNOME 40, using Nouveau and Wayland. (But the problem goes back at least to Fedora 32.)
- Hardware: Dell P2720D monitor connected by DisplayPort to a Dell 7779 laptop with Intel HD Graphics 620 and NVIDIA GeForce 940MX.
Thanks for reading!