InexactError() when running Pkg.test("GLVisualize") with VirtualGL

I’m running Julia with VirtualGL on a remote visualization node, and when I attempt to run Pkg.test(“GLVisualize”) I get an “Inexact error()”. Not sure if this could be related to VGL, but I thought I’d mention it. Other OpenGL applications are working fine with VirtualGL. I see that this error has been addressed in the past, https://github.com/JuliaGL/GLVisualize.jl/issues/230, but perhaps for different reasons

Output is exactly:

julia> Pkg.test(“GLVisualize”)
GLVisualize INFO: Computing test dependencies for GLVisualize…
VirtualGL
INFO: No packages to install, update or remove
INFO: Testing GLVisualize
ERROR: LoadError: LoadError: InexactError()
Stacktrace:
[1] trunc(::Type{Int64}, ::Float64) at ./float.jl:672
[2] #RunnerConfig#15(::Tuple{Int64,Int64}, ::Bool, ::Array{String,1}, ::Array{String,1}, ::Int64, ::Float64, ::Int64, ::String, ::Bool, ::Bool, ::Bool, ::GLWindow.Screen, ::Type{T} where T) at /home/qwofford/.julia/v0.6/GLVisualize/src/…/examples/ExampleRunner.jl:220
[3] (::Core.#kw#Type)(::Array{Any,1}, ::Type{ExampleRunner.RunnerConfig}) at ./:0
[4] include_from_node1(::String) at ./loading.jl:576
[5] include(::String) at ./sysimg.jl:14
[6] include_from_node1(::String) at ./loading.jl:576
[7] include(::String) at ./sysimg.jl:14
[8] process_options(::Base.JLOptions) at ./client.jl:305
[9] _start() at ./client.jl:371
while loading /home/qwofford/.julia/v0.6/GLVisualize/test/test_interactive.jl, in expression starting on line 30
while loading /home/qwofford/.julia/v0.6/GLVisualize/test/runtests.jl, in expression starting on line 12

The inexact error occurs on this line: https://github.com/JuliaGL/GLVisualize.jl/blob/master/examples/ExampleRunner.jl#L220

Since that’s related to the monitor size / dpi, I’m guessing there is something going wrong with querying the resolution of your monitor.

Can you execute the following:

julia> using GLVisualize

julia> w = glscreen();

julia> 1*GLVisualize.mm
4

And see what it prints?

Also, you might want to try a simple example first, e.g.:
https://github.com/JuliaGL/GLVisualize.jl/blob/master/examples/introduction/rotate_robj.jl

Thanks Simon!

I’m not familiar with Julia (yet), but I am assisting someone with a remote visualization use-case which involves Julia/GLVisualize, so I appreciate your specific suggestions.

julia> using GLVisualize

julia> w = glscreen();
NOTE: window came up, just froze the desktop image behind it, but was movable.
julia> 1*GLVisualize.mm
ERROR: InexactError()
Stacktrace:
[1] trunc(::Type{Int64}, ::Float64) at ./float.jl:672
[2] *(::Int64, ::GLVisualize.Millimeter) at /home/qwofford/.julia/v0.6/GLVisualize/src/renderloop.jl:46

I am going to spend some time with my /etc/X11/corg.conf file and see if I can find some missing relevant config that could provide an answer to Julia’s request for screen resolution. This is a headless server, so I expect this is what’s going on. Does this illuminate anything?

I’m running Julia on a headless node with VirtualGL (v2.5.9), so the “Monitor” section of my xorg.conf can’t have a resolution set. Instead, I can set a “Display” subsection for my “Screen” section, and define a “Virtual” resolution. This is the step I have tried since I last posted here. My modified xorg.conf file can be viewed at # nvidia-xconfig: X configuration file generated by nvidia-xconfig# nvidia-xco - Pastebin.com. You can see some attempts to set a resolution in the “Monitor” section, but both these attempts prevent lightdm from starting on a headless node (so they are commented out).

Unfortunately, even after adding the “Display” subsection to my “Screen” section, I am still getting an “InexactError()” when I run “using GLVisualize; w=glscreen(); 1*GLVisualize.mm;”

It sounds like the problem is that Julia is confused because I don’t have a monitor attached. Any ideas to get this working?

The “rotate_robj.jl” script you provided works great. I wonder why Pkg.test(“GLVisualize”) and the “1*GLVisualize.mm” is different?

I know that the first thing the user will do is attempt Pkg.test(“GLVisualize”) to verify functionality. Is there something I can do to fix this Pkg.test?

You could actually change the millimeter value directly.
I use this constant:
https://github.com/JuliaGL/GLVisualize.jl/blob/master/src/renderloop.jl#L40
to figure out how much pixel one mm on your screen is.
You can change that constant directly by running:

GLVisualize.pixel_per_mm[] = 4