MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.4k stars 306 forks source link

GLFWError #150

Closed XilinJia closed 5 years ago

XilinJia commented 6 years ago

Install and compile seem successful:

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.0) pkg> add Makie
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed Conda ───────────────────── v1.0.2
 Installed Primes ──────────────────── v0.4.0
 Installed Ratios ──────────────────── v0.3.0
 Installed PaddedViews ─────────────── v0.4.2
 Installed IterTools ───────────────── v1.0.0
 Installed FileIO ──────────────────── v1.0.1
 Installed CoordinateTransformations ─ v0.5.0
 Installed RangeArrays ─────────────── v0.3.1
 Installed ImageTransformations ────── v0.6.0
 Installed SignedDistanceFields ────── v0.4.0
 Installed SimpleTraits ────────────── v0.8.0
 Installed IndirectArrays ──────────── v0.5.0
 Installed QuartzImageIO ───────────── v0.5.0
 Installed IdentityRanges ──────────── v0.2.0
 Installed ColorVectorSpace ────────── v0.6.2
 Installed AxisAlgorithms ──────────── v0.3.0
 Installed UnicodeFun ──────────────── v0.4.0
 Installed Packing ─────────────────── v0.3.0
 Installed GLFW ────────────────────── v2.2.0
 Installed ImageAxes ───────────────── v0.5.0
 Installed Reactive ────────────────── v0.8.2
 Installed ImageCore ───────────────── v0.7.3
 Installed FreeType ────────────────── v2.1.1
 Installed VersionParsing ──────────── v1.1.3
 Installed OffsetArrays ────────────── v0.8.1
 Installed Parameters ──────────────── v0.10.1
 Installed CMake ───────────────────── v1.0.2
 Installed CMakeWrapper ────────────── v0.2.2
 Installed IntervalSets ────────────── v0.3.0
 Installed ModernGL ────────────────── v1.0.0
 Installed Interpolations ──────────── v0.9.1
 Installed FFTW ────────────────────── v0.2.4
 Installed SpecialFunctions ────────── v0.7.1
 Installed AbstractFFTs ────────────── v0.3.2
 Installed Rotations ───────────────── v0.9.1
 Installed ImageMagick ─────────────── v0.7.1
 Installed ColorBrewer ─────────────── v0.4.0
 Installed WoodburyMatrices ────────── v0.4.1
 Installed AxisArrays ──────────────── v0.3.0
 Installed MappedArrays ────────────── v0.2.1
 Installed GeometryTypes ───────────── v0.6.2
 Installed Makie ───────────────────── v0.9.0
 Installed AbstractPlotting ────────── v0.9.0
 Installed FreeTypeAbstraction ─────── v0.4.1
  Updating `~/.julia/environments/v1.0/Project.toml`
  [ee78f7c6] + Makie v0.9.0
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [621f4979] + AbstractFFTs v0.3.2
  [537997a7] + AbstractPlotting v0.9.0
  [13072b0f] + AxisAlgorithms v0.3.0
  [39de3d68] + AxisArrays v0.3.0
  [631607c0] + CMake v1.0.2
  [d5fb7624] + CMakeWrapper v0.2.2
  [a2cac450] + ColorBrewer v0.4.0
  [c3611d14] + ColorVectorSpace v0.6.2
  [8f4d0f93] + Conda v1.0.2
  [150eb455] + CoordinateTransformations v0.5.0
  [7a1cc6ca] + FFTW v0.2.4
  [5789e2e9] + FileIO v1.0.1
  [b38be410] + FreeType v2.1.1
  [663a7486] + FreeTypeAbstraction v0.4.1
  [f7f18e0c] + GLFW v2.2.0
  [4d00f742] + GeometryTypes v0.6.2
  [bbac6d45] + IdentityRanges v0.2.0
  [2803e5a7] + ImageAxes v0.5.0
  [a09fc81d] + ImageCore v0.7.3
  [6218d12a] + ImageMagick v0.7.1
  [02fcd773] + ImageTransformations v0.6.0
  [9b13fd28] + IndirectArrays v0.5.0
  [a98d9a8b] + Interpolations v0.9.1
  [8197267c] + IntervalSets v0.3.0
  [c8e1da08] + IterTools v1.0.0
  [1914dd2f] + MacroTools v0.4.4
  [ee78f7c6] + Makie v0.9.0
  [dbb5928d] + MappedArrays v0.2.1
  [66fc600b] + ModernGL v1.0.0
  [6fe1bfb0] + OffsetArrays v0.8.1
  [19eb6ba3] + Packing v0.3.0
  [5432bcbf] + PaddedViews v0.4.2
  [d96e819e] + Parameters v0.10.1
  [27ebfcd6] + Primes v0.4.0
  [dca85d43] + QuartzImageIO v0.5.0
  [b3c3ace0] + RangeArrays v0.3.1
  [c84ed2f1] + Ratios v0.3.0
  [a223df75] + Reactive v0.8.2
  [6038ab10] + Rotations v0.9.1
  [73760f76] + SignedDistanceFields v0.4.0
  [699a6c99] + SimpleTraits v0.8.0
  [276daf66] + SpecialFunctions v0.7.1
  [1cfade01] + UnicodeFun v0.4.0
  [81def892] + VersionParsing v1.1.3
  [efce3f68] + WoodburyMatrices v0.4.1
  Building Conda ───────────→ `~/.julia/packages/Conda/hsaaN/deps/build.log`
  Building CMake ───────────→ `~/.julia/packages/CMake/yag1A/deps/build.log`
  Building GLFW ────────────→ `~/.julia/packages/GLFW/pkSlg/deps/build.log`
  Building FreeType ────────→ `~/.julia/packages/FreeType/2dE5w/deps/build.log`
  Building FFTW ────────────→ `~/.julia/packages/FFTW/p7sLQ/deps/build.log`
  Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/sXbz6/deps/build.log`
  Building ImageMagick ─────→ `~/.julia/packages/ImageMagick/d5KBL/deps/build.log`

julia> using Makie
[ Info: Precompiling Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a]

But fails to run:

julia> Scene()
Error showing value of type Scene:
ERROR: GLFWError (VERSION_UNAVAILABLE): GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable
Stacktrace:
 [1] _ErrorCallbackWrapper(::Int32, ::Cstring) at /home/user/.julia/packages/GLFW/pkSlg/src/callback.jl:43
 [2] CreateWindow(::Int64, ::Int64, ::String, ::GLFW.Monitor, ::GLFW.Window) at /home/user/.julia/packages/GLFW/pkSlg/src/glfw3.jl:479
 [3] #Window#15(::String, ::Tuple{Int64,Int64}, ::Bool, ::Int64, ::Int64, ::Array{Tuple{UInt32,Int64},1}, ::Array{Tuple{UInt32,Integer},1}, ::Bool, ::Bool, ::Bool, ::Nothing, ::GLFW.Window, ::Type) at /home/user/.julia/packages/GLFW/pkSlg/src/glfw3.jl:338
 [4] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:name, :resolution, :windowhints, :visible),Tuple{String,Tuple{Int64,Int64},Array{Tuple{UInt32,Int64},1},Bool}}, ::Type{GLFW.Window}) at ./none:0
 [5] #Screen#61(::Tuple{Int64,Int64}, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type) at /home/user/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:132
 [6] Type at /home/user/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:125 [inlined]
 [7] global_gl_screen() at /home/user/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:188
 [8] display(::Makie.MakieDisplay, ::Scene) at /home/user/.julia/packages/Makie/YPDAk/src/Makie.jl:51
 [9] display(::Scene) at ./multimedia.jl:287
 [10] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [11] invokelatest at ./essentials.jl:685 [inlined]
 [12] print_response(::IO, ::Any, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:154
 [13] print_response(::REPL.AbstractREPL, ::Any, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:139
 [14] (::getfield(REPL, Symbol("#do_respond#40")){Bool,getfield(REPL, Symbol("##50#59")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:708
 [15] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [16] invokelatest at ./essentials.jl:685 [inlined]
 [17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2261
 [18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1029
 [19] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:191
 [20] (::getfield(Base, Symbol("##720#722")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
 [21] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [22] invokelatest at ./essentials.jl:685 [inlined]
 [23] macro expansion at ./logging.jl:308 [inlined]
 [24] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
 [25] exec_options(::Base.JLOptions) at ./client.jl:242
 [26] _start() at ./client.jl:421
SimonDanisch commented 6 years ago

hi, on what system are you?! make sure you have the latest gpu drivers installed!

XilinJia commented 6 years ago

The system is Manjaro running in VirtualBox on a MacBook Pro. How can I find out what GPU drivers are missing?

SimonDanisch commented 6 years ago

ah virtual box is tough with opengl - or impossible? Not sure, might have changed in recent versions!

XilinJia commented 6 years ago

Oh. Opengl was my thing back in the 90's. But I haven't touched it for long. Might be a good occasion to revisit. Thanks for making Makie.

XilinJia commented 6 years ago

It's not due to VirtualBox. I did a test on a Ubuntu 18.04 in the same VirtualBox, and Makie works. Somehow there are some software not compatible on Manjaro.

You memtioned in the manual that GLFW requires "ffmpeg cmake xorg-dev" to compile. However, on Manjaro, I can't find xorg-dev, but GLFW seems to compile fine. Could that be a reason for Makie to fail to run?

XilinJia commented 6 years ago

Makie worked in Ubuntu because "Enable 3D Acceleration" on VirtualBox was NOT checked, and so (somehow), it uses a VMWare/SGI driver for glx, which supports a much later version of OpenGL (3.3 or so). If check "Enable 3D Acceleration", then Ubuntu uses a VirtualBox/Chromium driver, which is very premitive, and in this case, Makie fails as in Manjaro. I had the 3D Acceleration enabled for Manjaro. But if I disable it, Manjaro also got (the same?) VMWare/SGI driver, plus some errors like:

$ glxinfo -B
name of display: :0.0
**libGL error: pci id for fd 4: 80ee:beef, driver (null)
libGL error: No driver found
libGL error: failed to load driver: (null)**
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0xffffffff)
    Device: llvmpipe (LLVM 6.0, 256 bits) (0xffffffff)
    Version: 18.2.1
    Accelerated: no
    Video memory: 3828MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 18.2.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 18.2.1
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 18.2.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

When I run Makie now, I get a different error:

julia> using Makie
[ Info: Recompiling stale cache file /home/djia/.julia/compiled/v1.0/Makie/iZ1Bl.ji for Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a]

julia> scene = Scene()
**libGL error: pci id for fd 21: 80ee:beef, driver (null)
libGL error: No driver found
libGL error: failed to load driver: (null)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Error showing value of type Scene:
ERROR: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig**
Stacktrace:
 [1] _ErrorCallbackWrapper(::Int32, ::Cstring) at /home/djia/.julia/packages/GLFW/pkSlg/src/callback.jl:43
 [2] CreateWindow(::Int64, ::Int64, ::String, ::GLFW.Monitor, ::GLFW.Window) at /home/djia/.julia/packages/GLFW/pkSlg/src/glfw3.jl:479
 [3] #Window#15(::String, ::Tuple{Int64,Int64}, ::Bool, ::Int64, ::Int64, ::Array{Tuple{UInt32,Int64},1}, ::Array{Tuple{UInt32,Integer},1}, ::Bool, ::Bool, ::Bool, ::Nothing, ::GLFW.Window, ::Type) at /home/djia/.julia/packages/GLFW/pkSlg/src/glfw3.jl:338
 [4] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:name, :resolution, :windowhints, :visible),Tuple{String,Tuple{Int64,Int64},Array{Tuple{UInt32,Int64},1},Bool}}, ::Type{GLFW.Window}) at ./none:0
 [5] #Screen#61(::Tuple{Int64,Int64}, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type) at /home/djia/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:132
 [6] Type at /home/djia/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:125 [inlined]
 [7] global_gl_screen() at /home/djia/.julia/packages/Makie/YPDAk/src/glbackend/screen.jl:188
 [8] display(::Makie.MakieDisplay, ::Scene) at /home/djia/.julia/packages/Makie/YPDAk/src/Makie.jl:51
 [9] display(::Scene) at ./multimedia.jl:287
 [10] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [11] invokelatest at ./essentials.jl:685 [inlined]
 [12] print_response(::IO, ::Any, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:154
 [13] print_response(::REPL.AbstractREPL, ::Any, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:139
 [14] (::getfield(REPL, Symbol("#do_respond#40")){Bool,getfield(REPL, Symbol("##50#59")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:708
 [15] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [16] invokelatest at ./essentials.jl:685 [inlined]
 [17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2261
 [18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1029
 [19] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:191
 [20] (::getfield(Base, Symbol("##720#722")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
 [21] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [22] invokelatest at ./essentials.jl:685 [inlined]
 [23] macro expansion at ./logging.jl:308 [inlined]
 [24] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
 [25] exec_options(::Base.JLOptions) at ./client.jl:242
 [26] _start() at ./client.jl:421

I searched but couldn't find a solution to libGL error: failed to load driver

XilinJia commented 6 years ago

glxgears works though in Manjaro, inspite of the libGL errors.

SimonDanisch commented 6 years ago

That could be, because the opengl version is too low?!

SimonDanisch commented 6 years ago

Nevermind, seems to be 3.3

SimonDanisch commented 6 years ago

But I had a pretty bad experience with the llvm pipe software renderer so far - lots of bugs when you use higher opengl versions.

cstjean commented 6 years ago

I'm also getting the same GLXBadFBConfig error. On Ubuntu, Julia 1.0.1,

Fri Oct  5 12:46:50 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48                 Driver Version: 410.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 980 Ti  Off  | 00000000:06:00.0 Off |                  N/A |
|  0%   58C    P0    68W / 390W |      0MiB /  6083MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
drrmmng commented 6 years ago

I successfully precompiled the packages on Ubuntu 18.04 after doing the following: terminal: sudo apt install libglfw3 libglfw3-dev

pkg3: add GLFW Makie build precompile

I guess only the first step is necessary.

SimonDanisch commented 5 years ago

Please report GLFW issues after checking: