Comments (5)
Do you happen to run on an optimus configuration?
from glsl-debugger.
No, it's not optimus. It's a desktop. GeForce GTX 680 and Intel 3770K. I was able to reproduce it today with updated packages.
from glsl-debugger.
I had the same issue and found two reasons:
- The NVIDIA driver uses libglvnd since nvidia-361 for dispatching GL, GLX, and EGL calls to different vendor-specific libraries depending on what library it deems most suitable for the given display device. NVIDIA's
libGLX.so
is a wrapper library that first calls__glx_Main(...)
on all known vendor libraries (libGLX_nvidia.so
,libGLX_indirect.so
, ...) to get the library's function table and version information. Afterwards,libGLX.so
dispatches all other function calls to one of the vendor libraries. The GLSL-Debugger interferes with this mechanism by intercepting the call to__glx_Main(...)
and bouncing it back to the dispatcherlibGLX.so
, where the function is undefined and a dynamically created stub method answersNULL
. As the dispatcher library does not recognize any vendor library, all subsequent GLX calls fail. The same happens forlibEGL.so
and__egl_Main(...)
. One possibility to patch this issue would be to pass calls to these methods to the originaldlsym()
:
Index: GLSL-Debugger/glsldb/DebugLib/libglsldebug.c
===================================================================
--- GLSL-Debugger/glsldb/DebugLib/libglsldebug.c 2017-09-18 14:38:42.000000000 +0200
+++ GLSL-Debugger/glsldb/DebugLib/libglsldebug.c 2017-09-22 16:37:33.063630891 +0200
@@ -1321,6 +1321,11 @@
unsetenv("GLSL_DEBUGGER_DLSYM");
}
+ // Call original dlsym for internal methods of NVIDIA's libglvnd dispatcher
+ if (strcmp(symbol, "__glx_Main") == 0 || strncmp(symbol, "__egl_Main", 10) == 0) {
+ return g.origdlsym(handle, symbol);
+ }
+
if (g.initialized) {
sym = (void*)glXGetProcAddressHook((GLubyte *)symbol);
if (sym) {
- The name of
libGL.so
is hardcoded inglsldb/DebugLib/libglsldebug.c
. On my Ubuntu 14.04 system, this is a problem as for some reasonld-linux.so
resolveslibGL.so
to the Mesa library (fromlibgl1-mesa-dev
), butlibGL.so.1
is resolved to NVIDIA's GLVND dispatcher:
$ ldconfig -p | grep x86-64.*libGL.so
libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-375/libGL.so.1 -> libGL.so.1.0.0
libGL.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so.1.2.0
libGL.so (libc6,x86-64) => /usr/lib/nvidia-375/libGL.so -> libGL.so.1.0.0
When I run glxgears
outside the debugger, libGL.so.1
resolves to NVIDIA's dispatcher and everything is fine. When I run glxgears
inside the debugger, the hard-coded libGL.so
resolves to Mesa while libGLX.so.0
still resolves to NVIDIA's dispatcher, which obviously causes trouble. Disabling USE_DLSYM_HARDCODED_LIB
works for me, but there's probably a reason for hard-coding libGL.so
and disabling the flag might have side effects on other systems.
from glsl-debugger.
I was having a similar problem
glXQueryExtensionsString -> returns NULL
glXChooseFBConfig -> returns NULL or count 0
I also use the NVIDIA driver on Linux.
I can confirm the above post solved my issue - rebuilding after patching the code as indicated and also commenting out at the top of the file.
//#define USE_DLSYM_HARDCODED_LIB
from glsl-debugger.
I think the best solution would be to avoid dlsym
ming private symbols at all. Otherwise we can get failures to e.g. load DRI drivers, which I got on Ubuntu 18.04 with Intel GPU (this version of Ubuntu uses libglvnd even when Mesa is the only driver installed). Here's how I fixed this (commit):
diff --git a/glsldb/DebugLib/libglsldebug.c b/glsldb/DebugLib/libglsldebug.c
index 32c293f..f871e13 100644
--- a/glsldb/DebugLib/libglsldebug.c
+++ b/glsldb/DebugLib/libglsldebug.c
@@ -1321,7 +1321,7 @@ void *dlsym(void *handle, const char *symbol)
unsetenv("GLSL_DEBUGGER_DLSYM");
}
- if (g.initialized) {
+ if (g.initialized && !(symbol[0]=='_' && symbol[1]=='_')) {
sym = (void*)glXGetProcAddressHook((GLubyte *)symbol);
if (sym) {
return sym;
from glsl-debugger.
Related Issues (20)
- Warn on uninitialized uniform values HOT 5
- Error when making file on glenumerants.c: #include "generated/glenumerants.h" HOT 3
- CMake scripts broken on Windows
- undefined reference to freeShChangeableList HOT 6
- Hangs when testing JOGL application HOT 1
- Segfault when debugging shader HOT 2
- Problems building on Windows with VS2015 HOT 7
- Can't debug forking applications HOT 2
- [Question] Is it possible to attach to running programs on Linux and record OpenGL traces? HOT 3
- Online Help menu option broken HOT 2
- Compiling on OSX HOT 2
- Debugger is forced to kill
- Build fails HOT 2
- 64bit call to CreateRemoteThread crashes target 64bit executable.
- Tooltips have colors that are very hard to read HOT 2
- Could you please offer windows exe file? HOT 4
- MHook library does not work in Win64 environment HOT 6
- Cannot debug program with Python interpreter HOT 3
- cannot compile, waste whole day HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glsl-debugger.