OpenGL in headless Mode

If you are forwarding, then it is likely some of the OpenGL and/or GPU content needs to run on the host PC and not the Jetson. See:
https://forums.developer.nvidia.com/t/running-graphical-cuda-sample-over-ssh-from-within-l4t-docker-container/113027/3

Does your operation work when running natively on the Jetson without forwarding? There is a very big difference between forwarding and a virtual server. Forwarding sends events, not results of events, and it is up to the PC to have all of the correct OpenGL and CUDA abilities when forwarding. When X is on the Jetson, and the program is running on the Jetson, then it is the Jetson’s libraries and GPU which does the work. A virtual desktop still runs locally to the Jetson, but instead of a physical display it has a program which can forward to another host (with the Jetson GPU and libraries doing the work).

An example of a virtual desktop which NVIDIA has tested on a Jetson is Vino. See “apt search vino”.