| 23 | |
| 24 | == Simulator does not start (libGL error) == |
| 25 | |
| 26 | If you have a message like this one at executing the simulator: |
| 27 | {{{ |
| 28 | libGL error: unable to load driver: i965_dri.so |
| 29 | }}} |
| 30 | |
| 31 | The idea is that we're using the system video card driver since it's not included in robomap3. |
| 32 | |
| 33 | The driver itself (eg: i965_dri.so) should be loaded automatically (from /usr/lib/x86_64-linux-gnu/dri/). But this driver may not succesfully load since it requires some specific library versions that may not match robomap3's. |
| 34 | |
| 35 | To debug this you should launch your 3D graphic program (eg: simulator) with the LIBGL_DEBUG environment variable set to verbose. |
| 36 | For example |
| 37 | {{{ |
| 38 | $ LIBGL_DEBUG=verbose ./LineFollower_simulator_nrt -n x4_0 -t x4 -a 127.0.0.1 -p 9000 -x setup_x4.xml (...) |
| 39 | }}} |
| 40 | Notice the line that look like {{{ libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/dri/i965_dri.so) }}}. |
| 41 | This means that the local system driver needs a version of libstdc++.so.6 that defines the symbol CXXABI_1.3.9 (meaning application binary interface version 1.3.9). |
| 42 | The version of libstdc++ included in robomap3 probably doesn't define this symbol. You can make sure with |
| 43 | {{{ |
| 44 | strings /.../robomap3/1.7.3/core2-64/sysroots/core2-64-poky-linux/usr/lib/libstdc++.so.6 | grep CXXABI_ |
| 45 | }}} |
| 46 | So we need to preload the libstdc++ library of the system to avoid robomap3 one to be loaded. |
| 47 | To achieve this we need to set the LD_PRELOAD environment variable like this |
| 48 | {{{ |
| 49 | LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./LineFollower_simulator_nrt ... |
| 50 | }}} |
| 51 | |
| 52 | |
| 53 | Stopping here may be enough, but you then can see errors like {{{ i965_dri.so: undefined symbol: nouveau_drm_new }}}. |
| 54 | |
| 55 | Same problem: the driver needs a version of a library (here libdrm_nouveau.so.2) which defines a specific symbol that doesn't exist in robomap3 version (yet). |
| 56 | |
| 57 | Same solution: preload the local system library. |
| 58 | Repeat this until all unresolved symbols are gone. |
| 59 | |
| 60 | * On ubuntu 16.10 with robomap3 1.7.3, I ended up with the following |
| 61 | {{{ |
| 62 | LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libdrm_intel.so.1:/usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2:/usr/lib/x86_64-linux-gnu/libdrm_radeon.so.1 ./LineFollower_simulator_nrt -n x4_0 -t x4 ... |
| 63 | }}} |
| 64 | |
| 65 | * On mint 19.1 with robomap 2.1.3, I ended up with the following |
| 66 | {{{ |
| 67 | LD_PRELOAD=/lib/x86_64-linux-gnu/libm.so.6:/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./LineFollower_simulator_nrt -n x4_0 -t x4 ... |
| 68 | }}} |
| 69 | |
| 70 | |
| 71 | To avoid setting this variable every time, you can modify the script used to launch the program (usually in build/bin, eg: simulator_xx.sh) and add this line __after__ the first one |
| 72 | {{{ |
| 73 | export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libdrm_intel.so.1:/usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2:/usr/lib/x86_64-linux-gnu/libdrm_radeon.so.1 |
| 74 | }}} |