Open diegoferigo opened 3 years ago
I remembered some preliminary tests did in https://github.com/robotology/gym-ignition/issues/279, where a specific ogre version was necessary. There, I was building the entire colcon workspace using dependencies provided by a conda environment.
Downgrading ogre to the functioning version I reported, ogre does not segfault. Here below the environment changes.
~ 🅒 test
❯ mamba install ogre==1.10.12
__ __ __ __
/ \ / \ / \ / \
/ \/ \/ \/ \
███████████████/ /██/ /██/ /██/ /████████████████████████
/ / \ / \ / \ / \ \____
/ / \_/ \_/ \_/ \ o \__,
/ _/ \_____/ `
|/
███╗ ███╗ █████╗ ███╗ ███╗██████╗ █████╗
████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
██╔████╔██║███████║██╔████╔██║██████╔╝███████║
██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
██║ ╚═╝ ██║██║ ██║██║ ╚═╝ ██║██████╔╝██║ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝
mamba (0.11.3) supported by @QuantStack
GitHub: https://github.com/mamba-org/mamba
Twitter: https://twitter.com/QuantStack
█████████████████████████████████████████████████████████████
Looking for: ['ogre==1.10.12']
conda-forge/linux-64 Using cache
conda-forge/noarch Using cache
pkgs/r/linux-64 [====================] (00m:00s) No change
pkgs/r/noarch [====================] (00m:00s) No change
pkgs/main/noarch [====================] (00m:00s) No change
pkgs/main/linux-64 [====================] (00m:00s) No change
Transaction
Prefix: /conda/envs/test
Updating specs:
- ogre==1.10.12
Package Version Build Channel Size
────────────────────────────────────────────────────────────────────────────────
Change:
────────────────────────────────────────────────────────────────────────────────
libignition-gui4 4.3.0 h3975b97_1 installed
libignition-gui4 4.3.0 hfcbbd8f_1 conda-forge/linux-64 870 KB
libignition-rendering4 4.7.0 hd9181ad_1 installed
libignition-rendering4 4.7.0 h65e549c_1 conda-forge/linux-64 2 MB
Downgrade:
────────────────────────────────────────────────────────────────────────────────
ogre 1.12.11 h89131c6_0 installed
ogre 1.10.12 hf655ca9_7 conda-forge/linux-64 116 MB
Summary:
Change: 2 packages
Downgrade: 1 packages
Total download: 119 MB
────────────────────────────────────────────────────────────────────────────────
Confirm changes: [Y/n] y
Finished libignition-gui4 (00m:00s) 870 KB 867 KB/s
Finished libignition-rendering4 (00m:01s) 2 MB 2 MB/s
Finished ogre (00m:30s) 116 MB 6 MB/s
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Thanks @diegoferigo, indeed we are building the Ignition libraries for both Ogre 1.10 and 1.12 at the moment, so I updated the title.
The same problem happens with libignition-gazebo6 with ogre 1.12, while with ogre 1.10 works fine. Based on an old Gazebo issue ( https://github.com/osrf/gazebo/issues/2700 ) the fix seems just to add the correct missing directories to IGN_RENDERING_RESOURCE_PATH
, i.e. after running:
export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media
at least Ignition Gazebo starts.
Cool - should we just amend the activation script to fix this issue?
Yes, I actually wanted to check on a real Linux machine if that permitted to get ign gazebo to work, as ign gazebo on its own does not work on macOS or Windows, but I guess that also just fixing that aspect would not harm.
In particular, Ign Gazebo seems to start, but it prints the following error:
[GUI] [Err] [OgreRTShaderSystem.cc:527] Unable to find shader lib. Shader generating will fail.
[GUI] [Err] [OgreRTShaderSystem.cc:112] Cannot find OGRE rtshaderlib. Shadows will be disabled.
However, even on WSL2 I am able to see something with the same rendering artefacts I have with ogre 1.10, so I guess it is worth to add export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media
.
@Tobias-Fischer do you have any idea on how to modify the build script of libignition-rendering6
to add $CONDA_PREFIX/share/OGRE/Media
only if ogre >= 1.12 is used? I am a bit out of ideas on that one.
I'm not sure at all. Do you want me to ask on gitter?
I'm not sure at all. Do you want me to ask on gitter?
Good idea. I tought we could also just always add $CONDA_PREFIX/share/OGRE/Media
also if Ogre is 1.10, but this results in the error:
[GUI] [Err] [OgreRTShaderSystem.cc:527] Unable to find shader lib. Shader generating will fail.
[GUI] [Err] [OgreRTShaderSystem.cc:112] Cannot find OGRE rtshaderlib. Shadows will be disabled.
being printed. Not sure if this actually influnce the rendering, as in WSL2 with Xming the rendering does not work correctly, not sure if it is due to the error:
qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-traversaro'
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
WARNING: Application calling GLX 1.3 function "glXQueryDrawable" when GLX 1.3 is not supported! This is an application bug!
that is also printed.
Actually thinking about it - can't we simply do something like this in the activate script? When activating the environment, the packages are installed so we can simply check if a desired file exists. This would only work for ogre==1.12 (not >=1.12) but it might be a good start?
if compgen -G "$CONDA_PREFIX/lib/libOgreMain.so.1.12.*" > /dev/null; then
export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media
fi
WSL2 with Xming the rendering does not work correctly
This is actually not true! Simple the default world does not render anything useful, so it is not clear if anything works. By running ign gazebo --render-engine ogre shapes.sdf
with ogre.10 I get:
While just by setting
export IGN_RENDERING_RESOURCE_PATH=$IGN_RENDERING_RESOURCE_PATH:$CONDA_PREFIX/share/OGRE/Media
indeed the rendering is not working correctly, I wonder if due to the shader problems mentioned in https://github.com/conda-forge/libignition-gazebo-feedstock/issues/6#issuecomment-940845213 :
Actually, I do not think that adding $CONDA_PREFIX/share/OGRE/Media
to IGN_RENDERING_RESOURCE_PATH
is doing anything in particular: the gui start even if you just set IGN_RENDERING_RESOURCE_PATH
to random value:
export IGN_RENDERING_RESOURCE_PATH=ayeyebrazov
The point is that if you check the code (for example https://github.com/ignitionrobotics/ign-rendering/blob/c1b0a4112ae6e4dcb3bf3238022c7b6a33bba009/ogre/src/OgreRTShaderSystem.cc#L480) the IGN_RENDERING_RESOURCE_PATH
is always meant to be a single directory, not a list of directories.
Differently from Gazebo Classic, in which GAZEBO_RESOURCE_PATH
is meant to store a list of directories and so the workaround is easy, in Ignition Rendering IGN_RENDERING_RESOURCE_PATH
is meant to point to a single directory, so it is not easy to force Ogre to add some directories to the resource manager. However, to easily check if the problem can be solved, I just copied the files in a directory where they can be found:
cp ${CONDA_PREFIX}/share/OGRE/Media/ShadowVolume/* ${CONDA_PREFIX}/share/ignition/ignition-rendering6/ogre/media/rtshaderlib150/
After doing so, indeed the error changes:
(ign-gazebo-ogre-12) traversaro@IITICUBLAP257:~/mambaforge/envs/ign-gazebo-ogre-12/bin$ ign gazebo --render-engine ogre shapes.sdf
qt.qpa.xcb: X server does not support XInput 2
failed to get the current screen resources
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-traversaro'
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
WARNING: Application calling GLX 1.3 function "glXQueryDrawable" when GLX 1.3 is not supported! This is an application bug!
terminate called after throwing an instance of 'Ogre::RuntimeAssertionException'
what(): RuntimeAssertionException: gpu program could not be created in createGpuPrograms at /home/conda/feedstock_root/build_artifacts/ogre_1630271808061/work/Components/RTShaderSystem/src/OgreShaderProgramManager.cpp (line 251)
This is indeed an error similar to https://github.com/osrf/gazebo/issues/2700 . However, thanks to the experience in https://github.com/ignitionrobotics/ign-gazebo/issues/1116, I discovered that for ogre errors once should check the ogre.log
, that in this case give as errors:
18:44:20: All done
18:44:20: Added resource location '/home/traversaro/mambaforge/envs/ign-gazebo-ogre-12/share/ignition/ignition-rendering6/ogre/media/rtshaderlib150' of type 'FileSystem' to resource group 'General'
18:44:20: Added resource location '/home/traversaro/mambaforge/envs/ign-gazebo-ogre-12/share/ignition/ignition-rendering6/media/materials/textures/com.png' of type 'FileSystem' to resource group 'General'
18:44:20: Program 'ea96c539ed38a286b56bd964a9c49f1a_VS' is not supported: 'ea96c539ed38a286b56bd964a9c49f1a_VS' 0:49(2): error: no matching function for call to `C(mat3, vec3, vec3)'; candidates are:
0:49(2): error: void FFP_Transform(mat4, vec4, vec4)
0:49(2): error: void FFP_Transform(mat4, vec4, vec3)
0:49(2): error: void FFP_Transform(mat3x4, vec3, vec3)
0:49(2): error: void FFP_Transform(mat4, vec3, vec3)
18:44:20: Error: RTSS - creating GpuPrograms for pass 0 of 'scene::Material(65500)' failed
Great investigative work! The ogre error to me looks like an upstream bug?
Great investigative work! The ogre error to me looks like an upstream bug?
I am not sure. If we go back to the similar Ogre 1.12 error for Classic Gazebo (issue https://github.com/osrf/gazebo/issues/2700) according to https://github.com/osrf/gazebo/issues/2700#issuecomment-894739606 the problem occured in the change from 1.12.4 to 1.12.5. But in https://github.com/robotology/robotology-superbuild-dependencies-vcpkg v0.7.0, I have a build of Gazebo that works fine with Ogre 1.12.9 built via vcpkg, without even adding anything to any env variable. What I noticed is that the vcpkg build of ogre does something strange with the resources.cfg
file (see https://github.com/microsoft/vcpkg/blob/2169ab765b49cfc5cd7eddfc8ff3e579326776f8/ports/ogre/portfile.cmake#L83), so I guess that the vcpkg's build of ogre somehow is able to find all that resources on its own, by loading the resources.cfg
file, while the conda build of ogre (and also the stock build used in flatpack) is not using the resources.cfg
. In particular, the resources.cfg
file installed by vcpkg is:
# Ogre Core Resources
[OgreInternal]
FileSystem=../Media/ShadowVolume
FileSystem=../Media/RTShaderLib/materials
FileSystem=../Media/RTShaderLib/GLSL
FileSystem=../Media/RTShaderLib/HLSL_Cg
FileSystem=../Media/Terrain/
# Resources required by the sample browser and most samples.
[Essential]
Zip=../Media/packs/SdkTrays.zip
Zip=../Media/packs/profiler.zip
FileSystem=../Media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[General]
# Bites uses the next entry to discover the platform shaders
FileSystem=../Media
FileSystem=../Media/fonts
FileSystem=../Media/materials/programs
FileSystem=../Media/materials/scripts
FileSystem=../Media/materials/textures
FileSystem=../Media/materials/textures/terrain
FileSystem=../Media/models
FileSystem=../Media/particle
FileSystem=../Media/DeferredShadingMedia
FileSystem=../Media/DeferredShadingMedia/DeferredShading/post
FileSystem=../Media/PCZAppMedia
FileSystem=../Media/materials/scripts/SSAO
FileSystem=../Media/materials/textures/SSAO
FileSystem=../Media/volumeTerrain
FileSystem=../Media/CSMShadows
Zip=../Media/packs/cubemap.zip
Zip=../Media/packs/cubemapsJS.zip
Zip=../Media/packs/dragon.zip
Zip=../Media/packs/fresneldemo.zip
Zip=../Media/packs/ogretestmap.zip
Zip=../Media/packs/ogredance.zip
Zip=../Media/packs/Sinbad.zip
Zip=../Media/packs/skybox.zip
Zip=../Media/volumeTerrain/volumeTerrainBig.zip
FileSystem=../Media/PBR
FileSystem=../Media/PBR/filament
FileSystem=../Media/materials/textures/PBR
Zip=../Media/packs/DamagedHelmet.zip
Zip=../Media/packs/filament_shaders.zip
FileSystem=../Media/HLMS
[BSPWorld]
Zip=../Media/packs/oa_rpg3dm2.pk3
# Materials for visual tests
[Tests]
FileSystem=../Tests/Media
(Note that the Media
directory is installed by vcpkg in <prefix>
, so in a different location w.r.t. to conda). Shaders are still a bit of a mistery for me, but I wonder if the compilation problem can be solved by adding some more directories to the Ogre resource locator, or convince ogre to read directories from the installed resources.cfg
file.
Hello. Is there any solution/fix to this problem? Setting IGN_RENDERING_RESOURCE_PATH
did not help me...
@traversaro I'm working on the flat rendering issue. I've fixed the RT Shader issues (pending PR in the ms-iot org); and have shadows. But the unshaded rendering has been driving me bonkers for longer than I'd care to admit...
ogre2/ogre-next is now working fine (see https://github.com/conda-forge/libignition-gazebo-feedstock/issues/27#issuecomment-1170911834), I think we can drop the ogre1.12 builds. The issue can be tackled if anyone wants to work on them.
Issue:
Even after the fix I proposed in https://github.com/conda-forge/libignition-gazebo-feedstock/issues/4#issuecomment-824709977, the GUI fails to open. Note that running just the server seems working fine. Here below the runtime error:
Verbose output
``` ~ 🅒 test ❯ ign gazebo -v [Msg] Ignition Gazebo Server v4.6.0 [Msg] Ignition Gazebo GUI v4.6.0 [Msg] Loading default world. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-dferigo' [Msg] Loaded level [3] [Msg] No systems loaded from SDF, loading defaults [Msg] Create service on [/world/default/create] [Msg] Remove service on [/world/default/remove] [Msg] Pose service on [/world/default/set_pose] [Msg] Light configuration service on [/world/default/light_config] [Msg] Physics service on [/world/default/set_physics] [Msg] Serving world controls on [/world/default/control] and [/world/default/playback/control] [Msg] Serving GUI information on [/world/default/gui/info] [Msg] World [default] initialized with [default_physics] physics profile. [Msg] Serving world SDF generation service on [/world/default/generate_world_sdf] [Msg] Serving world names on [/gazebo/worlds] [Msg] Resource path add service on [/gazebo/resource_paths/add]. [Msg] Resource path get service on [/gazebo/resource_paths/get]. [Msg] Resource paths published on [/gazebo/resource_paths]. [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Msg] Loading config [/home/dferigo/.ignition/gazebo/gui.config] [GUI] [Msg] Video recorder stats topic advertised on [/gui/record_video/stats] [GUI] [Msg] Transform mode service on [/gui/transform_mode] [GUI] [Msg] Record video service on [/gui/record_video] [GUI] [Msg] Move to service on [/gui/move_to] [GUI] [Msg] Follow service on [/gui/follow] [GUI] [Msg] View angle service on [/gui/view_angle] [GUI] [Msg] Move to pose service on [/gui/move_to/pose] [GUI] [Msg] Camera pose topic advertised on [/gui/camera/pose] [GUI] [Msg] View collisions service on [/gui/view/collisions] [GUI] [Msg] Added plugin [3D View] to main window [GUI] [Msg] Loaded plugin [GzScene3D] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libGzScene3D.so] [GUI] [Msg] Using world control service [/world/default/control] [GUI] [Msg] Listening to stats on [/world/default/stats] [GUI] [Msg] Added plugin [World control] to main window [GUI] [Msg] Loaded plugin [WorldControl] from path [/conda/envs/test/lib/ign-gui-4/plugins/libWorldControl.so] [GUI] [Msg] Listening to stats on [/world/default/stats] [GUI] [Msg] Added plugin [World stats] to main window [GUI] [Msg] Loaded plugin [WorldStats] from path [/conda/envs/test/lib/ign-gui-4/plugins/libWorldStats.so] [GUI] [Msg] Added plugin [Transform control] to main window [GUI] [Msg] Loaded plugin [TransformControl] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libTransformControl.so] [GUI] [Msg] Added plugin [Shapes] to main window [GUI] [Msg] Loaded plugin [Shapes] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libShapes.so] [GUI] [Msg] Added plugin [Component inspector] to main window [GUI] [Msg] Loaded plugin [ComponentInspector] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libComponentInspector.so] [GUI] [Msg] Added plugin [Entity tree] to main window [GUI] [Msg] Loaded plugin [EntityTree] from path [/conda/envs/test/lib/ign-gazebo-4/plugins/gui/libEntityTree.so] [GUI] [Wrn] [Application.cc:649] [QT] file::/Gazebo/GazeboDrawer.qml:178:3: QML Dialog: Binding loop detected for property "implicitHeight" [GUI] [Msg] Loading plugin [ignition-rendering-ogre] [GUI] [Wrn] [Application.cc:649] [QT] Qt has caught an exception thrown from an event handler. Throwing exceptions from an event handler is not supported in Qt. You must not let any exception whatsoever propagate through Qt code. If that is not possible, in Qt 5 you must at least reimplement QCoreApplication::notify() and catch all exceptions there. terminate called after throwing an instance of 'Ogre::RuntimeAssertionException' what(): RuntimeAssertionException: Ogre/ShadowExtrudePointLight not found. Verify that you referenced the 'ShadowVolume' folder in your resources.cfg in initialise at /home/conda/feedstock_root/build_artifacts/ogre_1618751642257/work/OgreMain/src/OgreShadowVolumeExtrudeProgram.cpp (line 70) [Msg] Found no publishers on /stats, adding root stats topic [Msg] Found no publishers on /clock, adding root clock topic [Msg] Serving scene information on [/world/default/scene/info] [Msg] Serving graph information on [/world/default/scene/graph] [Msg] Serving full state on [/world/default/state] [Msg] Serving full state (async) on [/world/default/state_async] [Msg] Publishing scene information on [/world/default/scene/info] [Msg] Publishing entity deletions on [/world/default/scene/deletion] [Msg] Publishing state changes on [/world/default/state] [Msg] Publishing pose messages on [/world/default/pose/info] [Msg] Publishing dynamic pose messages on [/world/default/dynamic_pose/info] ```Environment (
conda list
):Details about
conda
and system (conda info
):