# Slicer for Ubuntu arm64

**URL:** <https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459>\
**Category:** Development\
**Created:** [April 10, 2019, 9:30pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459 "2019-04-10T21:30:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 20, 2019, 3:16pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/21 "2019-04-20T15:16:50Z")

</div>

> [@adamrankin](#):
>
> OpenGL drivers for the Mali

This Arch Linux for ARM (gcc 8.2) setup provides the following mali drivers :

> libEGL.so.1.4, libGLESv1\_CM.so.1.1, libGLESv2.so.2.0, libOpenCL.so.1.1, libmali.so

They are installed, nevertheless, the 2D views remain black. Didn’t find any OpenGL ES 3.x driver.

I tried to specify VTK\_OPENGL\_HAS\_EGL, but VTK-build/CMakeCache.txt reported :

> //The OpenGL library being used supports EGL  
> VTK\_OPENGL\_HAS\_EGL:BOOL=OFF

So I just removed that flag during configure.

Perhaps this system is missing some library during build or at runtime.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 20, 2019, 11:03pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/22 "2019-04-20T23:03:16Z")

</div>

Compiled! Trying to run, and the install for libs is `<prefix>/lib/Slicer-4.11/libXYZ.so`. If I configure `<prefix>/lib` (I have other programs installed in that prefix) under `/etc/ld.so.conf.d/myconf.conf`, it doesn’t seem to pickup subdirectories. Do I have to add Slicer-4.11 as a folder in my ld config?

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 20, 2019, 11:33pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/23 "2019-04-20T23:33:18Z")

</div>

And CTK libs are not installed… @jcfr to install Slicer from build tree is it simply `make install` from `<SlicerSuperBuild>\Slicer-build` ?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 20, 2019, 11:46pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/24 "2019-04-20T23:46:01Z")

</div>

Do not install. Slicer can be launched from the build tree or you can create a self-contained package by building the PACKAGE target.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 22, 2019, 4:02pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/25 "2019-04-22T16:02:33Z")

</div>

Somehow I broke my GPU driver installation. Trying to sort that out, but then I think it will work!

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 22, 2019, 5:55pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/26 "2019-04-22T17:55:34Z")

</div>

Driver installation was not the problem. I don’t understand the linux graphics cluster&#!^%.

I am down to  
`QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled`

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 22, 2019, 6:11pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/27 "2019-04-22T18:11:34Z")

</div>

Does Slicer start at least ? Can you load a volume ? See the slices ? Do a quick volume rendering ? A segmentation ? Not that I’ll be able to help, just to know your actual results.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 22, 2019, 6:17pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/28 "2019-04-22T18:17:03Z")

</div>

No, Slicer doesn’t even start. abnormal exit (may make a Debug build to get more information).

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 22, 2019, 6:34pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/29 "2019-04-22T18:34:37Z")

</div>

I am investigating my VTK build. `OPENGL_gl_PREFERENCE` was set to `LEGACY`. Switching to `GLVND` now (no idea what this does, but hey!).

Also, updated VTK include and libs to use vendor provided EGL/GLES libraries (libmali.so symlinked)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 22, 2019, 6:47pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/30 "2019-04-22T18:47:53Z")

</div>

> [@adamrankin](#):
>
> my VTK build. `OPENGL_gl_PREFERENCE` was set to `LEGACY` . Switching to `GLVND` now (no idea what this does, but hey!).

Reading the message associated with this commit should help understand: [https://github.com/Slicer/Slicer/commit/245097a63c7e24eed5db95fa89b15c227b6f6ccb](https://github.com/Slicer/Slicer/commit/245097a63c7e24eed5db95fa89b15c227b6f6ccb)

Also copied below for convenience:

```plaintext
 BUG: Fix linux package removing dependency to GLVND libraries

By setting OpenGL_GL_PREFERENCE to LEGACY, this commit ensures that
the applications and libraries are linked against libGL.so (legacy) instead
of libOpenGL.so and libGLX.so (GL Vendor Neutral Dispatch library). It allows
to run the application on system where only libGL is available.

It fixes a regression introduced in r27988 (COMP: Update CMake minimum required
version from 3.5 to 3.13) after which one CMP0072 was set to NEW and led to
have the GLVND libraries being used by default.

Detailed explanation about GLVND (thanks @chuckatkins):
libOpenGL.so and libGLX.so are actually just the stub GLVND interface
libraries with no implementation behind them. GLVND uses a config file
to locate and dlopen the implementation at runtime like a plugin
(/usr/lib64/libGLX_nvidia.so.418.39 for instance).
So it's not really suitable for redistribution unless an implementation
like a glvnd-enabled mesa and associated config files are also packaged.
For broad redistributability, it is preferable to use use the legacy libGL
for now so at runtime it will be available on most systems.
That will likely need to be the case for the next few years until
the non-glvnd implementations are much less common.

Co-authored-by: Chuck Atkins <chuck.atkins@kitware.com>

```

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 23, 2019, 1:55am UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/31 "2019-04-23T01:55:50Z")

</div>

Removing any mention of `libGL.so` in VTK cmake. gl2ps (and related projects) have to be removed by editing their `CMakeLists.txt` or `module.cmake`. Currently VTK checks for `if(ANDROID or IOS)` which isn’t correct.

Remaining undefined references

```nohighlight
/opt/dev/S4R/VTK-build/lib/libvtkOpenGL-8.2.so.1: undefined reference to `glGetTexImage'
/opt/dev/S4R/VTK-build/lib/libvtkOpenGL-8.2.so.1: undefined reference to `glTexImage1D'
/opt/dev/S4R/VTK-build/lib/libvtkOpenGL-8.2.so.1: undefined reference to `glGetDoublev'
/opt/dev/S4R/VTK-build/lib/libvtkOpenGL-8.2.so.1: undefined reference to `glClearDepth'
/opt/dev/S4R/VTK-build/lib/libvtkOpenGL-8.2.so.1: undefined reference to `glDrawBuffer'

```

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 23, 2019, 3:37am UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/32 "2019-04-23T03:37:26Z")

</div>

Disabling `BUILD_TESTING` in Slicer removes more undefined references.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 23, 2019, 3:02pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/33 "2019-04-23T15:02:04Z")

</div>

To expand, you can simplify this by changing  
`<Slicer-build>VTK\CMake\vtkOpenGL.cmake:134`

from

`find_library(OPENGL_gl_LIBRARY NAMES GLESv3)`  
to  
`find_library(OPENGL_gl_LIBRARY NAMES GLESv3 GLESv2)`  
(GLESv3 is an android specific library name, libGLESv2 on linux actually contains v3 functions)

To disable gl2ps:  
`<Slicer-build>\VTK\ThirdParty\gl2ps\module.cmake`  
`<Slicer-build>\VTK\Rendering\GL2PSOpenGL2\module.cmake`  
`<Slicer-build>\VTK\IO\ExportOpenGL2\module.cmake`  
have them return immediately, up to you if you change the if condition or just remove the if condition.

`<Slicer-build>VTK\IO\Export\module.cmake`  
change/remove the if condition so that the depends variable is left blank (equivalent to ANDROID or APPLE\_IOS condition met)  
`<Slicer-build>VTK\IO\Export\CMakeLists.txt`  
comment out or remove vtkGL2PSExporter.cxx

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 23, 2019, 4:01pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/34 "2019-04-23T16:01:53Z")

</div>

Docker image (I think):  
[https://cloud.docker.com/u/adamrankin/repository/docker/adamrankin/slicer4arm](https://cloud.docker.com/u/adamrankin/repository/docker/adamrankin/slicer4arm)

Edit: wait for next tag, many dependencies I mounted to local drives. Moving into container now.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [April 23, 2019, 5:44pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/35 "2019-04-23T17:44:57Z")

</div>

> [@adamrankin](#):
>
> QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

After reading the above, I installed qt5-xcb-private-headers and xcb-util-cursor, then rebuilt everything. Now the slices are displayed in the 2D views.

Nice hint, thanks.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 27, 2019, 10:44pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/36 "2019-04-27T22:44:58Z")

</div>

Ok, so trying to build VTK with GLES doesn’t seem to work. I have no idea how they do it for Android.

vtkRenderingContextOpenGL2 relies on OpenGL defines and functions. @jcfr do you think anyone at Kitware would have any use for this use-case (single-board computers with GPU acceleration)?

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 28, 2019, 8:41pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/37 "2019-04-28T20:41:46Z")

</div>

Did some workarounds by substituting closest GLES equivalent (GL\_LINE vs GL\_LINES, etc…) and commenting out some gl points logic/functions.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 29, 2019, 12:54am UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/38 "2019-04-29T00:54:04Z")

</div>

In `<Slicer>/Libs/vtkAddon/CMakeLists.txt`  
remove section that includes OpenGL classes

In Slicer CMake, disable tests `BUILD_TESTING:BOOL=OFF`

In VTK, defined OPENGL\_ES\_VERSION:STRING=3.0 (maybe 3.2 would work? my system has headers for 3.2)

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 29, 2019, 2:54am UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/39 "2019-04-29T02:54:04Z")

</div>

in `<Slicer>/Libs/MRML/Widgets/qMRMLPlotView.cxx::saveAsSVG` comment out contents of function

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [April 30, 2019, 3:42pm UTC](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459/40 "2019-04-30T15:42:41Z")

</div>

Developer provided docker image

> **[GitHub - friendlyarm/friendlyelec-ubuntu18-docker: This docker image is used...](https://github.com/friendlyarm/friendlyelec-ubuntu18-docker)**
>
> This docker image is used to cross-compile Qt application for FriendlyELEC RK3399 platform. - GitHub - friendlyarm/friendlyelec-ubuntu18-docker: This docker image is used to cross-compile Qt applic...

[Previous page](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459.md?page=1)

[Next page](https://discourse.slicer.org/t/slicer-for-ubuntu-arm64/6459.md?page=3)
