Python3 pip install vtk: OpenGL2 Error - python-3.x

I'm trying to install vtk via pip for Python 3.5.1 under CentOS 7.2. It seems to install and work with the system Python 2.7 instead. I get an OpenGL driver incompatibility error with Python 3.
I must use sudo. My attempts:
sudo /path/to/pip3 install vtk
sudo /path/to/python3 -m /path/to/pip3 install vtk
When executing a simple cylinder example Python 2 works properly. Python 3 error messaage:
ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkShaderProgram.cxx, line 446
vtkShaderProgram (0x169d500): 0:31(12): error: extension `GL_EXT_gpu_shader4' unsupported in fragment shader
glxinfo output:
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.4
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits)
OpenGL version string: 2.1 Mesa 10.6.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.6.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
I get the same error with Mesa 17.x. Has anyone installed this under Python 3 with success? What version of Mesa and/or llvm is compatible?

The answer posted here works.
MESA_GL_VERSION_OVERRIDE=3.3 /path/to/executable
I had tried this so many times with a manual install that I gave up on it. I've also seen here that this is a bad idea.
Edit:
I've had to crank up the override version number to 4.5 on other installs.

Related

THC/THC.h: No such file or directory

I am trying to compile this with cuda support: https://github.com/CharlesShang/DCNv2 for a Project. But everytime I try it gives me this error message:
/THC.h: No such file or directory
9 | #include <THC/THC.h>
I am using:
Arch Linux with kernel version 6.1.4
GTX 1080
python 3.6
pytorch 1.2.0
torchvision 0.4.0
cudatoolkit 10.0
gcc 7.5
I thought it might be incompatible cuda and gcc versions, but I tried multiple combinations and none of them worked. At the moment I am using cuda 10.0 with gcc version 7.5 as it should be compatible.
Any help is greatly appreciated.

Use llvmpipe instead of softpipe in yocto

I have an old x86 machine. I build generic intel-core2-i32 machine configuration and installed yocto on it. Display is very slow.
Ubuntu 12.04 runs smoothly on the same machine. Graphics driver is same on both cases : gma500_gfx
Then i looked into glxinfo and found the difference, ubuntu12.04 is using Gallium on llvmpipe
Whereas yocto is using:
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: softpipe
OpenGL core profile version string: 3.3 (Core Profile) Mesa 19.0.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 19.0.3
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 19.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
How can i change the OpenGL renderer string to "llvmpipe" on Yocto and will this help
You should start by checking that llvmpipe driver is actually enabled. The mesa recipe configuration has this suspicious bit (I believe swrast here really means llvmpipe):
GALLIUMDRIVERS = "swrast"
# gallium swrast was found to crash Xorg on startup in x32 qemu
GALLIUMDRIVERS_x86-x32 = ""
Check the configuration logs or the resulting packages: if llvmpipe is not being built, try removing the last line above and see if that improves things.

GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver

I have downloaded ParaView for Linux(from their web site).I try to run the code but
vtkXOpenGLRenderWindow (0x37418c0): GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2.
My gl info
glxinfo | grep "OpenGL version"
OpenGL version string: 2.1 Mesa 11.0.0-rc1
milenko#milenko-HP-Compaq-6830s:~/ParaView-5.0.1/bin$ glxinfo | grep 'version'
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 2.1 Mesa 11.0.0-rc1
OpenGL shading language version string: 1.30
glxinfo | egrep 'OpenGL|glx'
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD RV620 (DRM 2.40.0, LLVM 3.4.0)
OpenGL version string: 2.1 Mesa 11.0.0-rc1
OpenGL shading language version string: 1.30
OpenGL extensions:
With lspci | grep -i vga
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV620/M82 [Mobility Radeon HD 3410/3430]
My X driver
glxinfo | grep -i vendor
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: X.Org
Mesa is not outdated,I do not understand what should I do. I am on Ubuntu 14.04,64bit.
Your GL implementation is insufficient for the new requirements for ParaView with version 5.0. Linux binaries from paraview.org are bundled with a approriate Mesa 3D build with required extension. Try running paraview as follows to use that Mesa:
paraview --mesa-llvm
See this blog for details.

Does my computer support OpenGL 2.1?

Basing from the above image, is the max version of Opengl my computer can support is 1.4? does that mean that there's no way I can write code with Opengl 2.1?
I'm using Ubuntu 12.04
What you see there is the GLX version. GLX is the container protocol, that delivers OpenGL to the X11 server. You should look for the OpenGL version string, which comes a bit later in that output. Use grep to filter the output, e.g. on my laptop
datenwolf#narfi ~
%> glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 2.1 Mesa 8.0.3
OpenGL shading language version string: 1.20
As you can see, my GLX version is 1.4 as well, but I have OpenGL 2.1 and GLSL 1.20 support on my mobile machine.

Shortest OpenGL geometry shader example that will run on Linux?

I am looking for a a short OpenGL geometry shader example that will run on Linux, preferably with as few dependencies as possible. Basically I want to use that program as a test to see if geometry shaders are supported at all on the system it's currently running on.
Just use glxinfo (in the package mesa-utils on Ubuntu/Debian) and check the extension list (GL_EXT/ARB_geometry_shader4) or OpenGL version (>= 3.2) for geometry shader support.
Extension example:
user#machine:~$ glxinfo | grep "GL_EXT_framebuffer_object"
GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_object,
Version example:
user#machine:~$ glxinfo | grep "OpenGL version"
OpenGL version string: 2.1 Mesa 7.10.2

Resources