Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Test fails to run on Mac #62

Closed
dpsanders opened this issue Feb 27, 2016 · 22 comments
Closed

Test fails to run on Mac #62

dpsanders opened this issue Feb 27, 2016 · 22 comments

Comments

@dpsanders
Copy link
Contributor

I desperately wanted this to work, but...

https://gist.github.com/321de67dfcda9d6b9d3e

Note that this is on an underpowered MacBook (the newish, small one) with the following (inbuilt) graphics card:

Intel HD Graphics 5300:

Chipset Model: Intel HD Graphics 5300
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel (0x8086)
Device ID: 0x161e
Revision ID: 0x0009
Displays:
Color LCD:
Display Type: Retina LCD
Resolution: 2304 x 1440 Retina
Retina: Yes
Pixel Depth: 32-Bit Color (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Built-In: Yes

julia> versioninfo()
Julia Version 0.4.2
Commit bb73f34 (2015-12-06 21:47 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
@Gnimuc
Copy link

Gnimuc commented Feb 27, 2016

same problem here, "ARB_conservative_depth" is a feature of OpenGL 4.2, but Mac still get stuck in 4.1 for now. ref: https://www.opengl.org/registry/specs/ARB/conservative_depth.txt

@SimonDanisch
Copy link
Member

Can you comment out this line and try again?
https://github.com/JuliaGL/GLVisualize.jl/blob/master/src/types.jl#L238
Since this even work on Ubuntu with a HD 4400, it's more likely that it's just complaining about the extension!

@tknopp
Copy link

tknopp commented Feb 27, 2016

yes this solves the issue. Could you test for the OGL version and make this conditional?

@SimonDanisch
Copy link
Member

Great :) Yeah something like that... I'll create a fix tomorrow ;)

@SimonDanisch
Copy link
Member

Another idea... Can you report the output of these:

using GLWindow, ModernGL
GLWindow.create_glcontext()
i = glGetIntegerv(GL_NUM_EXTENSIONS)
exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i-1)]
filter(exts) do e
       contains(e, "depth")
end

and in a new session:

using GLWindow, ModernGL
GLWindow.create_glcontext(major=4, minor=1)
i = glGetIntegerv(GL_NUM_EXTENSIONS)
exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i-1)]
filter(exts) do e
       contains(e, "depth")
end

@tknopp
Copy link

tknopp commented Feb 28, 2016

julia> using GLWindow, ModernGL

julia> GLWindow.create_glcontext()
GLFW.Window(Ptr{Void} @0x00007fe2dbbe2b30,[#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef])

julia> i = glGetIntegerv(GL_NUM_EXTENSIONS)
45

julia> exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i-1)]
45-element Array{ByteString,1}:
 "GL_ARB_blend_func_extended"                
 "GL_ARB_draw_buffers_blend"                 
 "GL_ARB_draw_indirect"                      
 "GL_ARB_ES2_compatibility"                  
 "GL_ARB_explicit_attrib_location"           
 "GL_ARB_gpu_shader_fp64"                    
 "GL_ARB_gpu_shader5"                        
 "GL_ARB_instanced_arrays"                   
 "GL_ARB_internalformat_query"               
 "GL_ARB_occlusion_query2"                   
 "GL_ARB_sample_shading"                     
 "GL_ARB_sampler_objects"                    
 "GL_ARB_separate_shader_objects"            
 "GL_ARB_shader_bit_encoding"                
 "GL_ARB_shader_subroutine"                  
 "GL_ARB_shading_language_include"           
 "GL_ARB_tessellation_shader"                
 "GL_ARB_texture_buffer_object_rgb32"        
 "GL_ARB_texture_cube_map_array"             
 "GL_ARB_texture_gather"                     
 "GL_ARB_texture_query_lod"                  
 "GL_ARB_texture_rgb10_a2ui"                 
 "GL_ARB_texture_storage"                    
 "GL_ARB_texture_swizzle"                    
 "GL_ARB_timer_query"                        
 "GL_ARB_transform_feedback2"                
 "GL_ARB_transform_feedback3"                
 "GL_ARB_vertex_attrib_64bit"                
 "GL_ARB_vertex_type_2_10_10_10_rev"         
 "GL_ARB_viewport_array"                     
 "GL_EXT_debug_label"                        
 "GL_EXT_debug_marker"                       
 "GL_EXT_framebuffer_multisample_blit_scaled"
 "GL_EXT_texture_compression_s3tc"           
 "GL_EXT_texture_filter_anisotropic"         
 "GL_EXT_texture_sRGB_decode"                
 "GL_APPLE_client_storage"                   
 "GL_APPLE_container_object_shareable"       
 "GL_APPLE_flush_render"                     
 "GL_APPLE_object_purgeable"                 
 "GL_APPLE_rgb_422"                          
 "GL_APPLE_row_bytes"                        
 "GL_APPLE_texture_range"                    
 "GL_ATI_texture_mirror_once"                
 "GL_NV_texture_barrier"                     

julia> filter(exts) do e
              contains(e, "depth")
       end
0-element Array{ByteString,1}

julia> 

@tknopp
Copy link

tknopp commented Feb 28, 2016

julia> using GLWindow, ModernGL

julia> GLWindow.create_glcontext(major=4, minor=1)
ERROR: NSGL: The targeted version of OS X only supports core profile contexts for OpenGL 3.2 and above
 in error at /Applications/Julia-0.4.2.app/Contents/Resources/julia/lib/julia/sys.dylib
 in anonymous at /Users/knopp/.julia/v0.4/GLFW/src/GLFW.jl:26
 in ##ErrorCallbackWrapper#7018 at /Users/knopp/.julia/v0.4/GLFW/src/callback.jl:50
 in CreateWindow at /Users/knopp/.julia/v0.4/GLFW/src/glfw3.jl:342
 in create_glcontext at /Users/knopp/.julia/v0.4/GLWindow/src/screen.jl:206
 in create_glcontext at /Users/knopp/.julia/v0.4/GLWindow/src/screen.jl:191

julia> i = glGetIntegerv(GL_NUM_EXTENSIONS)

signal (11): Segmentation fault: 11
glGetIntegerv at /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib (unknown line)
glGetIntegerv at /Users/knopp/.julia/v0.4/ModernGL/src/functionloading.jl:39
glGetIntegerv at /Users/knopp/.julia/v0.4/GLAbstraction/src/GLExtendedFunctions.jl:98
jlcall_glGetIntegerv_21524 at  (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:55
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:213
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:219
eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:592
jl_toplevel_eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:527
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:521
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:579
eval_user_input at REPL.jl:62
jlcall_eval_user_input_21202 at  (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
anonymous at REPL.jl:92
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
Segmentation fault: 11

@SimonDanisch
Copy link
Member

What?! :D
can you try:

using GLWindow, ModernGL
GLWindow.create_glcontext(major=4, minor=1)
i = Ref{GLint}(0)
glGetIntegerv(GL_NUM_EXTENSIONS, i)
exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i[]-1)]
filter(exts) do e
       contains(e, "depth")
end

@SimonDanisch
Copy link
Member

Sorry, I didn't read the error entirely...That's sort of to be expected...Let me fix this first!

@SimonDanisch
Copy link
Member

Okay, now:

Pkg.checkout("GLWindow")
using GLWindow, ModernGL
GLWindow.create_glcontext(major=4, minor=1)
bytestring(glGetString(GL_VERSION))
i = glGetIntegerv(GL_NUM_EXTENSIONS)
exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i-1)];
filter(exts) do e
       contains(e, "depth")
end

@tknopp
Copy link

tknopp commented Feb 28, 2016

julia> Pkg.checkout("GLWindow")
INFO: Checking out GLWindow master...
INFO: Pulling GLWindow latest master...
INFO: No packages to install, update or remove

julia> using GLWindow, ModernGL
INFO: Recompiling stale cache file /Users/knopp/.julia/lib/v0.4/GLWindow.ji for module GLWindow.

julia> GLWindow.create_glcontext(major=4, minor=1)
GLFW.Window(Ptr{Void} @0x00007f994bb8c710,[#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef])

julia> bytestring(glGetString(GL_VERSION))
"4.1 INTEL-10.2.46"

julia> i = glGetIntegerv(GL_NUM_EXTENSIONS)
45

julia> exts = [bytestring(glGetStringi(GL_EXTENSIONS, x)) for x=0:(i-1)];

julia> filter(exts) do e
              contains(e, "depth")
       end
0-element Array{ByteString,1}

julia> 

@SimonDanisch
Copy link
Member

Thanks! Sorry that I need to use you for this annoying kind of debugging!
But can you try one last thing before I take this away from OSX:
Go to this line https://github.com/JuliaGL/GLVisualize.jl/blob/master/src/renderloop.jl#L9
and turn it into:

screen = Screen(name, resolution=resolution, debugging=debugging, major=4, minor=1) 
# I don't know what your maximum supported minor is, so you could also try
# minor = 2 or, 3, or 4

@SimonDanisch
Copy link
Member

This must go together with the first fix, since it doesn't have the extension. But with some luck, it could just offer it without extension. I just can't believe, that the infamous linux drivers for an older graphic card support this and OSX with a relatively good OpenGL support doesn't ;)

@tknopp
Copy link

tknopp commented Feb 28, 2016

no does not seem to work. If I change minor to 2 I get an issue

julia> window = glscreen()
ERROR: The requested client API version is unavailable

Note that Apple is ditching OpenGL in favor for Metal. So unfortunately support will not be improved.

@SimonDanisch
Copy link
Member

Yeah I know... It's such an incredibly annoying move by Apple...

@SimonDanisch
Copy link
Member

Can you see if #64 fixes it?
Thanks! :)

@tknopp
Copy link

tknopp commented Feb 28, 2016

Nope. I did

Pkg.checkout("GLVisualize","sd/fixosx")

and still get

WARNING: shader /Users/knopp/.julia/v0.4/GLVisualize/src/../assets/shader/volume.frag didn't compile. 
ERROR: 0:182: Unknown identifier 'depth_greater' in layout

@SimonDanisch
Copy link
Member

Sorry I should have tested it better :( Now it should work!

@dpsanders
Copy link
Contributor Author

OK, it's now working!! Thanks a lot. For reference, here is what I see. Is it correct?
screen shot 2016-02-28 at 10 51 56 pm

@dpsanders
Copy link
Contributor Author

(That's the contents of the window that pops up.)

@tknopp
Copy link

tknopp commented Feb 29, 2016

yea works now. Thanks Simon

@dpsanders
Copy link
Contributor Author

Thanks! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants