Linking to OpenGL libraries on Linux (NVidia optirun primus)
Posted: 04 Jun 2013, 08:53
Hi
There is a bug with the pre-compiled version of V-REP for Linux 32 and 64 bit.
It will only affect a small number of users and could potentially be fixed by compiling from source, so maybe you won't consider it a bug.
Various laptops come with a dual-mode graphics system called NVidia Optimus.
On Windows, the driver will seamlessly select either the low-power graphics adapter or the high-power 3D graphics adapter if required.
On Linux, the driver is not that advanced yet and requires manual selection of the required graphics adapter.
So typically you run a program like
# ./vrep.sh
But if you want to use the NVidia graphics adapter you must run
# optirun ./vrep.sh
I have tested this on Ubuntu 10.04.4 32-bit and 12.04.1 64-bit and the same behaviour occurs.
V-Rep throws this error when trying to execute it via optirun:
QGLContext::makeCurrent(): Cannot make invalid context current.
By enabling some debug messages using:
# export LIBGL_DEBUG=verbose
and again running:
# optirun ./vrep.sh
indicates that V-Rep is not loading because it is forcing to load libGL from /usr/lib/... instead of the NVidia version of the library in a different location, which optirun puts into LD_LIBRARY_PATH.
This thread describes a similar problem:
https://github.com/Bumblebee-Project/Bu ... issues/374
where the software program was compiled using rpath that overides the LD_LIBRARY_PATH, and thus the libraries required by optirun are ignored.
* Are you able to fix the linker settings in the pre-compiled Linux version please?
* Or can you give some recommendations on how to re-compile from source?
As a starting point, I followed the V-Rep manual and have tried to compile using the supplied v_rep.pro QT project on Ubuntu 12 64-bit.
It almost compiles, except I get an error:
'IDSN_INERTIA_FRAME' was not declared in this scope.
Grep'ing around for that name in all 4 source ZIP files it cannot be found.
* What am I doing wrong?
Also, two other users reported the same problem in:
viewtopic.php?f=5&t=227
Thank you.
There is a bug with the pre-compiled version of V-REP for Linux 32 and 64 bit.
It will only affect a small number of users and could potentially be fixed by compiling from source, so maybe you won't consider it a bug.
Various laptops come with a dual-mode graphics system called NVidia Optimus.
On Windows, the driver will seamlessly select either the low-power graphics adapter or the high-power 3D graphics adapter if required.
On Linux, the driver is not that advanced yet and requires manual selection of the required graphics adapter.
So typically you run a program like
# ./vrep.sh
But if you want to use the NVidia graphics adapter you must run
# optirun ./vrep.sh
I have tested this on Ubuntu 10.04.4 32-bit and 12.04.1 64-bit and the same behaviour occurs.
V-Rep throws this error when trying to execute it via optirun:
QGLContext::makeCurrent(): Cannot make invalid context current.
By enabling some debug messages using:
# export LIBGL_DEBUG=verbose
and again running:
# optirun ./vrep.sh
indicates that V-Rep is not loading because it is forcing to load libGL from /usr/lib/... instead of the NVidia version of the library in a different location, which optirun puts into LD_LIBRARY_PATH.
This thread describes a similar problem:
https://github.com/Bumblebee-Project/Bu ... issues/374
where the software program was compiled using rpath that overides the LD_LIBRARY_PATH, and thus the libraries required by optirun are ignored.
* Are you able to fix the linker settings in the pre-compiled Linux version please?
* Or can you give some recommendations on how to re-compile from source?
As a starting point, I followed the V-Rep manual and have tried to compile using the supplied v_rep.pro QT project on Ubuntu 12 64-bit.
It almost compiles, except I get an error:
'IDSN_INERTIA_FRAME' was not declared in this scope.
Grep'ing around for that name in all 4 source ZIP files it cannot be found.
* What am I doing wrong?
Also, two other users reported the same problem in:
viewtopic.php?f=5&t=227
Thank you.