[osg-users] "Error: Not able to create requested visual." for osg application utilizing multi-sampling, ran with optirun.

143 views
Skip to first unread message

Hamza Alloush

unread,
Aug 20, 2015, 3:45:25 PM8/20/15
to osg-...@lists.openscenegraph.org
Hello,

I'v been having trouble using optirun with the virtualgl rendering bridge, and an osg app utilizing multi-sampling.

using this simple example(attached also):

#include <stdio.h>
#include <stdlib.h>
#include <osgViewer/Viewer>
#include <osg/ShapeDrawable>
 
osg::Node* createScene()
{
    osg::Geode* geode = new osg::Geode();

    geode->addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,-2.0f),1.5f,2.0f) ) );
    geode->addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,-2.0f),1.5f,2.0f) ) );
    geode->addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(2.0f,0.0f,2.0f),1.5f,2.0f) ) );
    geode->addDrawable( new osg::ShapeDrawable( new osg::Cylinder(osg::Vec3(-2.0f,0.0f,2.0f),1.5f,2.0f) ) );

    return geode;
}

int main(int argc, char* argv[])
{
    // construct the viewer
    osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;

    // full screen antialiasing (if supported)
    osg::DisplaySettings::instance()->setNumMultiSamples( 4 );

    // make the viewer create a 512x512 window and position it at 32, 32
    viewer->setUpViewInWindow( 32, 32, 512, 512 );

    // set the scene-graph data the viewer will render
    viewer->setSceneData( createScene() );

    // execute main loop
    return viewer->run();
}

, as well as an actual app, like Flight Gear with multi-sampling enabled, would trigger an error such as:

Error: Not able to create requested visual.
  GraphicsWindow has not been created successfully.

if i used a primus rendering bridge(/usr/bin/optirun -b primus), or actually used the Nvidia driver without Optimus technology, the problem does not show. it only does show if i used an osg multi-sampled application using virtualgl as a rendering bridge for optirun, which is the default.

i used GDB to troubleshoot the built example, the problem is that the main function is considered one "frame", so a backtrace was useless, but i was able to narrow it down:

breakpoint at line 27:

(gdb) b 27
Breakpoint 1 at 0x40102d: file mutlisample.cpp, line 27.
(gdb) run
Starting program: /home/hamza/build/fgbuild/openscenegraph/src/multitest
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffdd48) at mutlisample.cpp:27
27        viewer->setUpViewInWindow( 32, 32, 512, 512 );
(gdb) bt
#0  main (argc=1, argv=0x7fffffffdd48) at mutlisample.cpp:27

breakpoint at line 28:

(gdb) b 28
Breakpoint 2 at 0x401060: file mutlisample.cpp, line 28.
(gdb) run
Starting program: /home/hamza/build/fgbuild/openscenegraph/src/multitest
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Error: Not able to create requested visual.
  GraphicsWindow has not been created successfully.

Breakpoint 2, main (argc=1, argv=0x7fffffffdd48) at mutlisample.cpp:30
30        viewer->setSceneData( createScene() );
(gdb) bt
#0  main (argc=1, argv=0x7fffffffdd48) at mutlisample.cpp:30

any tips would be appreciated

Thanks
Hamza

mutlisample.cpp

Jannik Heller

unread,
Aug 20, 2015, 6:53:11 PM8/20/15
to osg-...@lists.openscenegraph.org
This might be simply a driver limitation. Not all hardware and drivers support multisampling. For example, I'm using OSG on Mesa + Intel HD Graphics which doesn't support multisampling at all.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64858#64858





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Hamza Alloush

unread,
Aug 21, 2015, 3:09:59 AM8/21/15
to osg-...@lists.openscenegraph.org


----------------------------------------
> From: scr...@baseoftrash.de
> Date: Fri, 21 Aug 2015 00:53:46 +0200
> To: osg-...@lists.openscenegraph.org
> Subject: Re: [osg-users] "Error: Not able to create requested visual." for osg application utilizing multi-sampling, ran with optirun.
>
> This might be simply a driver limitation. Not all hardware and drivers support multisampling. For example, I'm using OSG on Mesa + Intel HD Graphics which doesn't support multisampling at all.
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

hi,

i have multi sampling working without optirun, here is my setup:

-Acer Aspire laptop
-Ubuntu 14.04
-Intel 3000 HD Graphics
-Nvidia GT 540 ( 346.82 )

It just doesn't work for some reason if i use optirun defaults(through a virtualgl rendering bridge) to run an osg app with multisample, with a "Error: Not able to create requested visual".

Hamza Alloush

unread,
Aug 21, 2015, 5:00:47 AM8/21/15
to osg-...@lists.openscenegraph.org


----------------------------------------
> From: hamzaa...@live.com
> To: osg-...@lists.openscenegraph.org
> Date: Fri, 21 Aug 2015 07:09:55 +0000
> Subject: Re: [osg-users] "Error: Not able to create requested visual." for osg application utilizing multi-sampling, ran with optirun.
>
>
>
> ----------------------------------------
>> From: scr...@baseoftrash.de
>> Date: Fri, 21 Aug 2015 00:53:46 +0200
>> To: osg-...@lists.openscenegraph.org
>> Subject: Re: [osg-users] "Error: Not able to create requested visual." for osg application utilizing multi-sampling, ran with optirun.
>>
>> This might be simply a driver limitation. Not all hardware and drivers support multisampling. For example, I'm using OSG on Mesa + Intel HD Graphics which doesn't support multisampling at all.
>> _______________________________________________
>> osg-users mailing list
>> osg-...@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> hi,
>
> i have multi sampling working without optirun, here is my setup:
>
> -Acer Aspire laptop
> -Ubuntu 14.04
> -Intel 3000 HD Graphics
> -Nvidia GT 540 ( 346.82 )
>
> It just doesn't work for some reason if i use optirun defaults(through a virtualgl rendering bridge) to run an osg app with multisample, with a "Error: Not able to create requested visual".
>
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

here's some more relevant info:

Ubuntu 14.04

libgl1-mesa-dri=10.1.3-0ubuntu0.4 (provides i915 Intel driver)
libgl1-mesa-glx=10.1.3-0ubuntu0.4 (provides /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0)
libgl1-mesa-dev=10.1.3-0ubuntu0.4 (provides symlink to the above in /usr/lib/x86_64-linux-gnu/libGL.so)
nvidia-346=346.82-0ubuntu0.2 (provides Nvidia driver)
bumblebee=3.2.1-93 (provides optirun and /etc/bumblebee/bumblebee.conf)

this is just for reference, but if someone would let me know what exactly multi sampling does to instancing a GraphicsContext that it Sigfaults when used with "virtualgl", i would appreciate it.

p.s: compile example with: "g++ multisample.cpp -losg -losgViewer -g -o multisampletest"

Thanks
Hamza
Reply all
Reply to author
Forward
0 new messages