Unable to use openGL X11 forwarding on jetson nano

You might want to check this out:
https://forums.developer.nvidia.com/t/running-graphical-cuda-sample-over-ssh-from-within-l4t-docker-container/113027/3

Long story short, you need to have a screen “context”, typically by setting the “DISPLAY” environment variable. No setting is the same as nothing to display to. Setting it to a remote system over ssh (requires the -X or -Y option) implies you have a context, but the context will not use the Jetson’s GPU (thus the host PC itself will have to have that functionality).

This is not a bug, it is just how forwarding and X11 context works.

If you truly want the context to be computed on the Jetson, then you have to either run it locally on the desktop there, or else have a virtual desktop (virtual desktops are a full desktop, but they don’t connect to a monitor…they do connect by remote desktop sharing software, but the program you run won’t know about this and will not care).