I have a Linux system with Mesa3D and llvmpipe software driver.
glxinfo reports
Extended renderer info (GLX_MESA_query_renderer):
Vendor: VMware, Inc. (0xffffffff)
Device: llvmpipe (LLVM 9.0, 128 bits) (0xffffffff)
Version: 19.2.8
Accelerated: no
Video memory: 65482MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
If I read this info correctly, OpenGL 3.3 has to be supported in core profile. Unfortunately, any OpenGL program starts only in OpenGL 3.1 mode (compatibility profile). For example,
~$ xvfb-run glxgears -info
GL_RENDERER = llvmpipe (LLVM 9.0, 128 bits)
GL_VERSION = 3.1 Mesa 19.2.8
GL_VENDOR = VMware, Inc.
...
Is there a way to start OpenGL programs with core 3.3 profile?
Unfortunately, any OpenGL program starts only in OpenGL 3.1 mode.
Not any GL program will do that. Only old programs which use the legacy context creation (so they don't even know or care about the existence of different profiles) will get this version.
(compatibility profile).
Actually, OpenGL 3.1 compatibility profile does not even exist. Profiles were introduced in OpenGL 3.2, even if mesa's interpretation of that slightly differs. Technically, mesa llvmpipe simply does not support compatibility profiles.
Is there a way to start OpenGL programs with core 3.3 profile?
Not in a useful way. If the program uses legacy context creation, it does either not know about newer GL functions (and will not be able to make use of them as a consequence), or it is just broken and simply assumes to get some newer GL version which is nothing a program can rely on, as per the spec.
In any case, if the program is not written for OpenGL core profile, is will most likely not function correctly, because a lot of deprecated legacy functionality is simply not available in core profiles.
Your example glxgears
will simply generate a lot of GL errors and only show a black screen wehn run in core profile, because it is using display lists and immediate mode rendering commands and the fixed-function pipeline, which are all not available in core profile OpenGL.
Allthough it is most likely quite useless, to make a program use core profile OpenGL which doesn't request it, you either can modify the source code, or you can somehow interfere with its context creation operations.
In some ironic turn of events, I myself just a few days ago added some functionality to my glx_hook
hack which actually allows to modify the context an application is requesting without having to modify the source code.