neurolabusc / surf-ice

GLSL surface rendering source code. Compiled versions available from NITRC. Loads 3DS, CTM, DXF, FreeSurfer, GII (GIfTI), GTS, LWO2, MS3D, MZ3, NV (BrainNetViewer), OBJ, OFF, PLY, STL, VTK. Tractography formats include BFloat, PDB, TCK, TRK, and VTK. Also NIfTI format voxelwise images.
https://www.nitrc.org/plugins/mwiki/index.php/surfice:MainPage
BSD 2-Clause "Simplified" License
104 stars 23 forks source link

Can't use Surfice #17

Closed dlevitas closed 4 years ago

dlevitas commented 4 years ago

I recently installed the linux September 2019 release of Surfice to my university's HPC (Red Hat Enterprise Linux Server 7.7 (Maipo)). While I am able to use SurficeOld, I am unable to use Surfice. I realize this is related to the OpenGL version, which on our HPC is 2.1 Mesa 18.3.4. What I find strange though is that I installed the software to my personal Mac laptop (MacOS Sierra version 10.12.6) and even though the OpenGL is 2.1 INTEL-10.25.24 I am able to use Surfice there. I'm unsure if I'm properly checking the OpenGL version, and if there is a way to use Surfice on our HPC?

Thanks,

Dan

neurolabusc commented 4 years ago

Dan-

SurficeOld requires OpenGL 2.1 or later, Surfice requires OpenGL Core 3.3 or later. MacOS can only support full OpenGL up to 2.1, but do provide support for OpenGL Core 3.3 and later. OpenGL Core removes many deprecated functions. Therefore, when you run an OpenGL program on MacOS it will report version 2.1 unless you request the core context. To see this, open Surfice on MacOS and choose the "About" menu item. On my computer, it reveals OpenGL 4.1 (Core):

Surf Ice v1.0.20191122 Beta 64-bit Cocoa
 hw.model: MacBookPro15,2
 ProductVersion:    10.14.6
 www.mricro.com :: BSD 2-Clause License (opensource.org/licenses/BSD-2-Clause)
 Scale 87.1677
 Origin 34.5208x-17.6963x15.8235
 Mesh Vertices 40962 Faces 81920 Colors 0
    0.5386..68.5030  -104.8640..69.4714 -48.3929..80.0398
 Track Vertices 0 Faces 0 Count 0
 Node Vertices 0 Faces 0
 GPU Intel Inc. :: OpenGL  4.1 INTEL-12.10.16 :: GLSL 4.10

On your Linux system, you might try MESA_GL_VERSION_OVERRIDE=3.3 surfice. One challenge with OpenGL 2.1 is that we can leverage several features that were optional extensions for that version, whereas all these features are required for OpenGL 3.3. Therefore, on a computer that supports all of these features, SurficeOld will provide almost the full feature set of Surfice. On the other had, if your hardware does not support these features your options will be very limited. If you can run both SurficeOld and Surfice, you should use the latter, as it is able to use the resources of your graphics card more efficiently.

dlevitas commented 4 years ago

Thanks @neurolabusc

Using that command MESA_GL_VERSION_OVERRIDE=3.3 surfice opens what I believe is SurficeOld since it looks the same, with the following information:

Surf Ice v1.0.20190902 64-bit Linux
 www.mricro.com :: BSD 2-Clause License (opensource.org/licenses/BSD-2-Clause)
 Scale 90.1804
 Origin 0.1146x-16.7897x5.0248
 Mesh Vertices 306038 Faces 612200 Colors 0
    -71.5431..71.7723  -106.9701..73.3907 -72.0000..82.0496
 Track Vertices 0 Faces 0 Count 0
 Node Vertices 0 Faces 0
 GPU VMware, Inc. :: OpenGL  3.3 (Core Profile) Mesa 18.3.4 :: GLSL 3.30

It isn't really an issue for me if I need to use SurficeOld; I was simply curious if I could get the newer version working.

neurolabusc commented 4 years ago

Success - You are running the modern version. If you run surficeOld you will see it mentions Legacy OpenGL in the first line of the version string. Assuming your hardware supports all the OpenGL 2.1 extensions, there will only be a few differences:

  1. The "AO" (ambient occlusion) and "Xray" features are slightly different.
  2. Different appearance of tractography if "Better but slower tracks" is un-checked in the preferences
  3. Some of the shaders at the bottom of the "Shaders" drop down menu are different.
  4. The Core version uses GPU resources more efficiently than the classic OpenGL (though Mesa may simply emulate modern calls with legacy features that would negate these benefits).

Happy to help, as this might help others. The reason I provide two versions is to support old hardware and servers.

dlevitas commented 4 years ago

Oh great! Thanks again for the assistance.