vaiorabbit / ruby-opengl

Yet another OpenGL wrapper for Ruby (and wrapper code generator).
Other
86 stars 11 forks source link

test samples on ArchLinux with nouveau #20

Closed cedlemo closed 9 years ago

cedlemo commented 9 years ago

@vaiorabbit :

I have tested all your sample with the nouveau driver instead of the nvidia environment:

The results:

.
├── ComputeShader
│   └── opengl_cs.rb                  tested (bad version 3.0 instead of 4.3) 
├── data
├── DebugOutput
│   └── debug_output.rb                 tested (bad version 3.0 instead of 4.3)
├── Extension
│   └── nvpr_hello_world.rb                 tested (bad version 3.0 instead of 3.2)
├── GLES
│   └── gles.rb
├── GLExcess
│   ├── data
│   ├── glxs_glut.rb                  ok
│   ├── glxs.rb                       ok
│   ├── scene01.rb
│   ├── scene02.rb
│   ├── scene03.rb
│   ├── scene04.rb
│   ├── scene05.rb
│   ├── scene06.rb
│   ├── scene06ship.rb
│   ├── scene07data.rb
│   ├── scene07.rb
│   ├── scene08.rb
│   ├── scene09.rb
│   ├── scene10.rb
│   ├── scene11.rb
│   ├── scene12.rb
│   └── texture.rb
├── GLUT
│   ├── glut_font.rb                ok
│   ├── glut_gears.rb               ok
│   ├── glut_menu.rb                ok
│   └── glut_minimal.rb             ok
├── NeHe
│   └── nehe_lesson36.rb            ok
├── OrangeBook
│   └── brick.rb                    ok
├── RedBook
│   ├── aapoly.rb                   ok
│   ├── alpha.rb                    ok
│   ├── bezmesh.rb                  ok
│   ├── surface.rb                  ok
│   ├── teapots.rb                  ok
│   └── varray.rb
├── report_env_es.rb       pb no window created
├── report_env.rb          ok
├── simple_glut.rb          ok (just needed to add /usr/lib for glfw)
├── simple.rb               ok (just needed to add /usr/lib for glfw)
├── teapot.rb               ok (just needed to add /usr/lib for glfw)
└── util
    ├── geometry.rb
    ├── setup_dll.rb
    └── WavefrontOBJ.rb

12 directories, 41 files

Errors:

needed to remove glfw3.dll reference and put

GLFW.load_lib('libglfw.so', '/usr/lib')

Error message:

Segfault :

home/cedlemo/.gem/ruby/2.2.0/gems/opengl-bindings-1.4.0/lib/glfw.rb:384: [BUG] Segmentation fault at 0x00000000000030
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0022 e:000021 CFUNC  :call
c:0003 p:0022 s:0016 e:000015 METHOD /home/cedlemo/.gem/ruby/2.2.0/gems/opengl-bindings-1.4.0/lib/glfw.rb:384
c:0002 p:0226 s:0011 E:000348 EVAL   gles.rb:111 [FINISH]
c:0001 p:0000 s:0002 E:001600 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
gles.rb:111:in `<main>'
/home/cedlemo/.gem/ruby/2.2.0/gems/opengl-bindings-1.4.0/lib/glfw.rb:384:in `glfwSetWindowPos'
/home/cedlemo/.gem/ruby/2.2.0/gems/opengl-bindings-1.4.0/lib/glfw.rb:384:in `call'

-- Machine register context ------------------------------------------------
 RIP: 0x00007f6d904df21c RBP: 0x00007ffd633d1770 RSP: 0x00007ffd633d1768
 RAX: 0x00007f6d906ec5c8 RBX: 0x00007ffd633d1770 RCX: 0x00007f6d956de5f2
 RDX: 0x0000000000000064 RDI: 0x0000000000000000 RSI: 0x0000000000000064
  R8: 0x0000000001def7a0  R9: 0x00007ffd633d17c0 R10: 0x00007ffd633d16c0
 R11: 0x00007f6d904df210 R12: 0x0000000000000018 R13: 0xfffffffffffffffc
 R14: 0x000000000225a570 R15: 0x00007ffd633d1888 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/usr/lib/libruby.so.2.2 [0x7f6d956ea915]
/usr/lib/libruby.so.2.2 [0x7f6d956eab4c]
/usr/lib/libruby.so.2.2 [0x7f6d955c4d4b]
/usr/lib/libruby.so.2.2 [0x7f6d9567c32e]
/usr/lib/libc.so.6 [0x7f6d951e65b0]
/usr/lib/libglfw.so(glfwSetWindowPos+0xc) [0x7f6d904df21c]
/usr/lib/libffi.so.6(ffi_call_unix64+0x4c) [0x7f6d937d51f0]
/usr/lib/libffi.so.6(ffi_call+0x2f8) [0x7f6d937d4c58]
/usr/lib/ruby/2.2.0/x86_64-linux/fiddle.so [0x7f6d939db979]
/usr/lib/libruby.so.2.2 [0x7f6d956d1d30]
/usr/lib/libruby.so.2.2 [0x7f6d956e244d]
/usr/lib/libruby.so.2.2 [0x7f6d956d6c1f]
/usr/lib/libruby.so.2.2 [0x7f6d956dba28]
/usr/lib/libruby.so.2.2(rb_iseq_eval_main+0x7f) [0x7f6d956dd18f]
/usr/lib/libruby.so.2.2 [0x7f6d955c7ebf]
/usr/lib/libruby.so.2.2(ruby_exec_node+0x1d) [0x7f6d955c9a2d]
/usr/lib/libruby.so.2.2(ruby_run_node+0x1e) [0x7f6d955cb8ae]
ruby [0x4008ab]
/usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f6d951d3790]
ruby(_start+0x29) [0x4008d9]

-- Other runtime information -----------------------------------------------

Environement:
Arch Linux x86_64 kernel 4.1.4-1-ARCH

ruby:

ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

OpenGl

ruby report_env.rb 
Version: 3.0 Mesa 10.6.3
Extensions:
GL_ARB_multisample
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_minmax
GL_EXT_blend_subtract
vaiorabbit commented 9 years ago

Hi, You can use the OpenGL ES 3 profile for PC only on the GPU/driver that can run OpenGL 4.3 or higher applications. So I have to fix gles.rb like:

    window = glfwCreateWindow( 320, 240, "OpenGL ES", nil, nil )
    if window.null?
      puts "Failed to create the OpenGL ES 3 context. You may need to get a GPU/driver that is compliant with OpenGL 4.3 or higher."
      exit
    end
    glfwSetWindowPos( window, 100, 100 )

Thank you for reporting.

vaiorabbit commented 9 years ago

I have just fixed these files.

cedlemo commented 9 years ago

Thx,

Can I send you a pull request in order to add the "nouveau" environment in the README.md?

You can close this after answering me. Thanks again.

vaiorabbit commented 9 years ago

Can I send you a pull request in order to add the "nouveau" environment in the README.md?

Yes, you can. Now I'll close this issue. Thank you.