GLMakie fails test on FreeBSD 12, Julia 1.1.0

(v1.1) pkg> test GLMakie
   Testing GLMakie
 Resolving package versions...
    Status `/tmp/tmp8KVQL5/Manifest.toml`
  [621f4979] AbstractFFTs v0.4.1
  [537997a7] AbstractPlotting v0.9.7
  ...
  [cf7118a7] UUIDs  [`@stdlib/UUIDs`]
  [4ec0a83e] Unicode  [`@stdlib/Unicode`]
[ Info: starting from index 1
running tutorial_simple_scatter
ERROR: LoadError: MethodError: no method matching backend_show(::Missing, ::IOContext{IOStream}, ::MIME{Symbol("image/jpeg")}, ::Scene)
Closest candidates are:
  backend_show(::Any, ::IO, ::MIME{Symbol("text/plain")}, ::Scene) at /usr/home/ko/.julia/packages/AbstractPlotting/UgfGB/src/display.jl:67
  backend_show(::Any, ::IO, ::MIME{Symbol("text/plain")}, ::Combined) at /usr/home/ko/.julia/packages/AbstractPlotting/UgfGB/src/display.jl:84
Stacktrace:

Can someone explain what is happening here? Thanks.

Did you have an build errors for ]build GLMakie?

The build shows some problems with ImageMagick, and with GLFW.

The ImageMagick problem is, in my opinion, somewhat bogus. I use the
FreeBSD system package for ImageMagick, with a deps.jl file that I created by hand. That’s because Julia’s build process for ImageMagick fails due to reasons I haven’t totally tracked down.

(v1.1) pkg> test ImageMagick
   Testing ImageMagick
 Resolving package versions...
 Status `/tmp/tmp64yzd7/Manifest.toml`
...
  [4ec0a83e] Unicode  [`@stdlib/Unicode`]
┌ Error: Exception while generating log record in module Main at /usr/home/ko/.julia/packages/ImageMagick/J74FC/test/runtests.jl:13
│   exception =
│    UndefVarError: libversion not defined
│    Stacktrace:
│     [1] getproperty(::Module, ::Symbol) at ./sysimg.jl:13
│     [2] top-level scope at logging.jl:319
│     [3] include at ./boot.jl:326 [inlined]
│     [4] include_relative(::Module, ::String) at ./loading.jl:1038
│     [5] include(::Module, ::String) at ./sysimg.jl:29
│     [6] include(::String) at ./client.jl:403
│     [7] top-level scope at none:0
│     [8] eval(::Module, ::Any) at ./boot.jl:328
│     [9] exec_options(::Base.JLOptions) at ./client.jl:243
│     [10] _start() at ./client.jl:436
└ @ Main ~/.julia/packages/ImageMagick/J74FC/test/runtests.jl:13
┌ Warning: Mapping to the storage type failed; perhaps your data had out-of-range values?
│ Try `map(clamp01nan, img)` to clamp values to a valid range.

I don’t know what’s going on here. Perhaps my deps.jl file?

The GLFW problem is

  Building GLFW ────────────→ `~/.julia/packages/GLFW/69NQ7/deps/build.log`
  Building GLMakie ─────────→ `~/.julia/packages/GLMakie/nDrlO/deps/build.log`
┌ Error: Error building `GLMakie`: 
│ libGL error: unable to load driver: r600_dri.so
│ libGL error: driver pointer missing
│ libGL error: failed to load driver: r600
│ libGL error: unable to load driver: swrast_dri.so
│ libGL error: failed to load driver: swrast
│ init error of GLFW
│ ERROR: LoadError: OpenGL/GLFW wasn't installed correctly. This likely means,
│ you don't have an OpenGL capable Graphic Card,
│ you don't have the newest video driver installed,

Again, for GLFW I use the FreeBSD package. Here is what happens with testing that individually:

(v1.1) pkg> test GLFW
   Testing GLFW
    Status `/tmp/tmpkFZTW4/Manifest.toml`
...
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
   Testing GLFW tests passed 

So this seems ok to me.

That does look anything but ok :smiley: The only reason this passes tests is, that GLFW has really bad tests, since its hard to test OpenGL^^
So, looks like you need to figure out why your video drivers aren’t installed correctly!

Well, here I’m out of my depth. The FreeBSD package for glfw includes some demos, all appear to work fine. To begin with,

/usr/local/share/examples/glfw/tests/glfwinfo
GLFW header version: 3.2.1
GLFW library version: 3.2.1
GLFW library version string: "3.2.1 X11 GLX EGL clock_gettime Xf86vm shared"
OpenGL context version string: "3.1 Mesa 18.3.2"
OpenGL context version parsed by GLFW: 3.1.0
OpenGL context flags (0x00000000):
OpenGL context flags parsed by GLFW:
OpenGL robustness strategy (0x00008261): none
OpenGL robustness strategy parsed by GLFW: none
OpenGL context renderer string: "AMD CEDAR (DRM 2.50.0 / 12.0-RELEASE-p4, LLVM 6.0.1)"
OpenGL context vendor string: "X.Org"
OpenGL context shading language version: "1.40"
OpenGL framebuffer:
 red: 8 green: 8 blue: 8 alpha: 8 depth: 24 stencil: 8
 samples: 0 sample buffers: 0
 accum red: 0 accum green: 0 accum blue: 0 accum alpha: 0 aux buffers: 0
Vulkan loader: missing

Then the standard demos ‘gears’ and ‘wave’ work fine.

They likely use software mode, which is fine for simple OpenGL, but not for Makie.
You need to install the correct AMD drivers, instead of using the Mesa drivers.

So Makie wants one of these two?

libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so

Makie wants real, gpu accelerated OpenGL - which you only get when you install the gpu drivers correctly.

After some digging around, my system has /usr/local/lib/dri/r600_dri.so.
It is part of the package ‘mesa-dri’:

pkg info mesa-dri
mesa-dri-18.3.2_2
Name           : mesa-dri
Version        : 18.3.2_2
Installed on   : Thu Apr 18 11:05:49 2019 EDT
Origin         : graphics/mesa-dri
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : graphics
Licenses       : 
Maintainer     : x11@FreeBSD.org
WWW            : http://www.mesa3d.org/
Comment        : OpenGL hardware acceleration drivers for DRI2+
Options        :
	VAAPI          : off
	VDPAU          : off
	WAYLAND        : on
Shared Libs required:
	libX11.so.6
	libxshmfence.so.1
	libexpat.so.1
	libLLVM-6.0.so
	libxcb-xfixes.so.0
	libwayland-client.so.0
	libXv.so.1
	libdrm_intel.so.1
	libxcb-present.so.0
	libunwind.so.8
	libX11-xcb.so.1
	libdrm_amdgpu.so.1
	libdrm.so.2
	libxcb-sync.so.1
	libxcb-dri3.so.0
	libxcb-randr.so.0
	libxcb.so.1
	libglapi.so.0
	libxcb-dri2.so.0
	libXvMC.so.1
	libdrm_radeon.so.1
Shared Libs provided:
	libvulkan_radeon.so
	libXvMCgallium.so.1
	libvulkan_intel.so
Annotations    :
	FreeBSD_version: 1200086
	repo_type      : binary
	repository     : FreeBSD
Flat size      : 29.1MiB
Description    :
This package contains the current stable release of the client drivers for DRI2+

With a X Server configured for DRI, they allow direct rendering of hardware-
accelerated OpenGL. This package also includes the software renderer, either
llvmpipe or classic SWrast.

WWW: http://www.mesa3d.org/

Can you give some hint as to how to proceed?

yeah mesa is the default… you need to install the official amd drivers!