Anatomist Vertex shader failed to compile

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Anatomist Vertex shader failed to compile

Post by fissell »

Hello,

I am trying to install BrainVISA/Anatomist on a Linux Ubuntu 64bit system.
I downloaded brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18.tar.
When I load a nifti file in Anatomist and then click on the axial button to
view, I get the error listed below. system details also below.

thanks very much for any help on this, and for contributing this software !
Kate

Error:
Vertex shader for simpleShaderProg (MainVertexShader & PositionOnlyVertexShader) failed to compile
Fragment shader for simpleShaderProg (MainFragmentShader & ShockingPinkSrcFragmentShader) failed to com
pile
Errors linking simple shader: ""
Vertex shader for blitShaderProg (MainWithTexCoordsVertexShader & UntransformedPositionVertexShader) fa
iled to compile
Fragment shader for blitShaderProg (MainFragmentShader & ImageSrcFragmentShader) failed to compile
Errors linking blit shader: ""

System:
Ubuntu 12.04.4 LTS
05:00.0 VGA compatible controller: NVIDIA Corporation GK104GL [Quadro K5000] (rev a1)
We are using nvidia_304 driver.
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist Vertex shader failed to compile

Post by riviere »

Hi,
I had not seen this error before, apparently your system supports shaders but is unable to use them. Could it be a driver installation problem ? I am a bit surprised because Ubuntu generally installs them correctly.
Anyway you can try disabling them in the preferences: in Anatomist main window, there is a menu "settings/preferences" or something like that. In the settings, go to the "OpenGL" tab, and uncheck "activate shaders". I hope rendering will be OK for you in this configuration. If yes, don't forget to save the settings.
Denis
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Re: Anatomist Vertex shader failed to compile

Post by fissell »

Hi,

Thanks for that idea. I think the "shader can't compile" error is resolved when
I work at the workstation console instead of ssh'ing in. At the console I now am
getting the error "Unrecognised OpenGL version"

I am just calling anatomist directly, not calling the env script, is that correct ?

These are the libs anatomist is using, look OK ?
> ldd /usr/local/pkg/brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18/bin/real-bin/anatomist | grep -i gl
libQtOpenGL.so.4 => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 (0x00007f6b18482000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f6b18214000)
libGL.so.1 => /usr/lib/nvidia-304/libGL.so.1 (0x00007f6b17ef7000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f6b1490b000)
libnvidia-glcore.so.304.116 => /usr/lib/nvidia-304/libnvidia-glcore.so.304.116 (0x00007f6b1134b000)

thank you,
Kate
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist Vertex shader failed to compile

Post by riviere »

Oh, you were running through a ssh tunnel and remote X server, this is an important detail... remote X and OpenGL is quite often not working very well and it is more or less a matter of... luck... (I guess it depends too much on combinations of X/GLX protocols, OpenGL server and OpenGL client implementations and versions on each side of the network, and maybe GLX does not support all openGL operations, maybe all shaders (?)).

Locally on the console, here it should work better, so why does it not ?
- if you run anatomist in the root brainvisa dir, or in the bin/ directory, then the env script should be called automatically (the commands there are actually scripts which setup their env before calling the real executable).
- if you directly call anatomist in bin/real-bin, then the env script is not called: there will probably be some libraries incompatibilities because anatomist has been compiled on a different system, and using different versions of many libraries, so it it probably not a good idea.
- Then, if libGL is the one from the system, Qt libs, including libQtOpenGL, should be the one from the brainvisa package, to ensure compatibility with anatomist and brainvisa. If you want to know which libs will actually be used, run:

Code: Select all

/usr/local/pkg/brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18/bin/bv_env ldd /usr/local/pkg/brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18/bin/real-bin/anatomist
It should point to libs as I just said.

Denis
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Re: Anatomist Vertex shader failed to compile

Post by fissell »

Hello Denis,

yes, I think the bv_env is setting LD_LIBRARY_PATH correctly, these are the libs pulled in:
> ldd /usr/local/pkg/brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18/bin/real-bin/anatomist | grep -i gl
libQtOpenGL.so.4 => /usr/local/pkg/brainvisa-Mandriva-2008.0-x86_64-4.4.0-2013_11_18/lib/libQtOpenGL.so.4 (0x00007f054e92d000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f054e6bf000)
libGL.so.1 => /usr/lib/nvidia-304/libGL.so.1 (0x00007f054e3a1000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f054ab90000)
libnvidia-glcore.so.304.116 => /usr/lib/nvidia-304/libnvidia-glcore.so.304.116 (0x00007f054732e000)

re the Unrecognised OpenGL version error when I click on axial/sagittal/coronal button to see a slice.
here is what glxinfo reports as to GL versions, are these OK ?
> glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 4.2.0 NVIDIA 304.116
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler

If I need to compile source, what is the best documentation for that ?
I went here:
http://brainvisa.info/doc/cartointernet ... /ch08.html
but the link required a login.
And other compile links pointed me to
http://brainvisa.info/doc/cartointernet ... /ch02.html
but I do not see build instructions in tutorial or manual.
Would I need to install brainvisa, aims, bv_maker, python et al or could
I just somehow compile anatomist and have it link to some parts from the downloaded
precompiled pkg ?

thanks very much
Kate
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist Vertex shader failed to compile

Post by riviere »

Well, your settings and GLX info look good. For me in the same situation it does work, running the Mandriva package on a Ubuntu system (14.04 right now but we have tried on 12.04 too).
So I wonder if it is really due to anatomist/brainvisa binaries.
Have you successfully used other OpenGL-based software on the same machine ?

Before compiling, you can also try with binaries built on Ubuntu 12.04. We have an unreleased test version (using a new installation system) here. This set of binaries have been compiled on Ubuntu 12.04 so they should match your system. Note that it is an "internal" test version, which is temporarily available there, and may be removed later.

To build from sources, the build instructions are on the sources repository server here (there is a link to it in the docs you have mentioned). Note that it is a https server which requires a login and password (it's required by our institution), but we have a "public" login (brainvisa) and assword (Soma2009) which are already in the URL link.
However it is quite long and a bit painful to build all the sources, so I guess you should try all the binary-based solutions first...

Denis
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Re: Anatomist Vertex shader failed to compile

Post by fissell »

Thank you !!!!
The pre-release download solved the unrecognised opengl issue.
On one machine I think there was an unresolved python link, I will
look at that next week.
That's a very nice installer app you have.
Could you keep that link active for a week or so ?


very many thanks
Kate
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist Vertex shader failed to compile

Post by riviere »

Hi,

Well, I'm happy that it solves the problem, but also a bit worried because I don't understand why the Mandriva release did not work for you...
The installer app will be used for next releases. It will stay where it is a little while, probably until we release a new official version (it has been there since december actually), then moved to a more definitive location. But it will not disapear in a few days.

Denis
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Re: Anatomist Vertex shader failed to compile

Post by fissell »

Hi,

Using the brainvisa_installer_x86_64_online program works fine if I install into my
home directory or another user's home directory, eg /home/fissell/brainvisa
If I install into /usr/local/pkg/brainvisa
I get a bad python link for /usr/pkg/brainvisa/lib/python2.7/config/Makefile (full error msg below).
I printed out the "show details" page from the installer for both installs and they are identical.
If the problem comes from line 329 in sysconfig.py, if _PYTHON_BUILD: not evaluating
to true, what determines whether _PYTHON_BUILD is true or false ?

As to OpenGL error, I also don't know the issue with the mandriva release vs the new installer.
I also don't know the full effect of the error statement, we could see images but I did not try
any advanced operations to see what might fail or to see what might have bad performance.
If you would like me to try some further test on the mandriva release on our system I would
be happy to do that.

thanks for all your help,
Kate

python error:

> /usr/local/pkg/brainvisa/bin/anatomist &
[2] 22856
> Starting Anatomist.....
config file : /home/fissell/.anatomist/config/settings.cfg
(warning: no config file /home/fissell/.anatomist/config/settings.cfg: creating it)
saved global configuration file : /home/fissell/.anatomist/config/settings.cfg
PyAnatomist Module present
Traceback (most recent call last):
File "/usr/local/pkg/brainvisa/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/local/pkg/brainvisa/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/pkg/brainvisa/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/pkg/brainvisa/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/pkg/brainvisa/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/local/pkg/brainvisa/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/local/pkg/brainvisa/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/local/pkg/brainvisa/lib/python2.7/sysconfig.py", line 344, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/pkg/brainvisa/lib/python2.7/config/Makefile (No such file or directory)
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Anatomist Vertex shader failed to compile

Post by riviere »

* python with installer and install in /usr/local:
You're right, python actually looks for its Makefile in /usr/pkg/... instead of /usr/local/pkg/... (I have made the test on my side, with the same effect).
It seems that this Ubuntu 12.04 install of python is somewhat rotten: in the function _get_makefile_filename() it explicitly replaces /usr/local with /usr (!)
Which means that installing anywhere else, not in /usr/local, would work.
I don't know who/why this silly replace occurs.
In Ubuntu 14.04, I see that this code is different, probably meaning that they fixed it. But if we want to release this Ubuntu 12.04 version we will have to make a patch for it.
In the meantime you can try patching it yourself, and removing the replcae(...) in line 331 in sysconfig.py:

Code: Select all

[    return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")/code]
by:
[code]    return os.path.join(get_path('platstdlib'), "config" + (sys.pydebug and "_d" or ""), "Makefile")
And you will have to do the same in line 416.
This works for me.

* OpenGL / Mandriva:
we could see images but I did not try any advanced operations to see what might fail or to see what might have bad performance
Oh so you can see something ? In this case, just try, it might work.
Shaders are only used optionally in alternative rendering pipelines, which for now only allow to do lighting/shadowing using alternative algorithms. It was setup mainly to allow shader-based extensions, and we have not released any for now. So it may work just well without it. If meshes and textured objects (slices of volume are) do render properly, then it's probably OK.

Denis
fissell
Posts: 6
Joined: Wed May 14, 2014 9:35 pm

Re: Anatomist Vertex shader failed to compile

Post by fissell »

Hi Denis,

Well, I took the lazy way out and just installed in /usr instead of /usr/local/pkg and
the install in fine.
Thanks very much for figuring that one out !

Kate
Post Reply