OpenGL doesn't have any way to do this except sometimes via vendor specific extensions. Basically how OpenGL works is it creates the graphics context on whichever device the system hands it. So you can configure the GPU used by OpenGL on the system level but not at the application level.
FYI, setting `NvOptimusEnablement` and `AmdPowerXpressRequestHighPerformance` have been the canonical way on Windows, `__NV_PRIME_RENDER_OFFLOAD` + `__GLX_VENDOR_LIBRARY_NAME` on Linux. Though not an OpenGL feature per se, as you mentioned.
That would be the vendor extensions they mentioned.
AFAIR there was a way to "list" existing output devices, so your app could select the proper one?
It does so via the respective OS way on how to create OpenGL context.