Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile ok but cannot run under ubuntu22 #139

Open
zhangfq-chemistry opened this issue Dec 22, 2024 · 9 comments
Open

compile ok but cannot run under ubuntu22 #139

zhangfq-chemistry opened this issue Dec 22, 2024 · 9 comments
Labels
GL OpenGL specific issue Linux

Comments

@zhangfq-chemistry
Copy link

selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46

@LukasBanana LukasBanana added GL OpenGL specific issue Linux labels Dec 22, 2024
@LukasBanana
Copy link
Owner

Hi, can you please provide some more information? For instance, did you reproduce this on a native Linux machine or a virtual machine?

I found these issues in other projects that seem related:

A suggestion from these threads I saw was to set the color bits from 32 to 24, effectively setting the alpha bits from 8 to 0.
You can try changing that in ExampleBase when the swap-chain is created as a workaround:

swapChainDesc.colorBits = 24;

Please let me know if that fixes the issue. I am only set up with Linux VMs at the moment.

@zhangfq-chemistry
Copy link
Author

zhangfq-chemistry commented Dec 25, 2024

I use native Linux machine.

(base) zhangfq@ThinkStation-Tiny:~/active-resource/LLGL/build_linux/build$ ./Example_C99_HelloTriangle
Renderer: OpenGL 4.6.0 NVIDIA 560.35.03
Device: NVIDIA T400 4GB/PCIe/SSE2
Vendor: NVIDIA Corporation
Shading Language: GLSL 4.60 NVIDIA
Vertex info

(0) : error C5145: must write to gl_Position

Segmentation fault (core dumped)

//--------------------------------------------------------------------------------------------
(base) zhangfq@ThinkStation-Tiny:~/active-resource/LLGL/build_linux/build$ ./Example_ClothPhysics
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46

My display graphic card information:
*-display
description: VGA compatible controller
product: TU117GL [T400 4GB]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
logical name: /dev/fb0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=nvidia latency=0 mode=2560x1440 visual=truecolor xres=2560 yres=1440
resources: iomemory:600-5ff iomemory:600-5ff irq:146 memory:81000000-81ffffff memory:6000000000-600fffffff memory:6010000000-6011ffffff ioport:3000(size=128) memory:82000000-8207ffff

@LukasBanana
Copy link
Owner

(0) : error C5145: must write to gl_Position

This error indicates that the vertex shader (and likely any other file) was not loaded correctly. Have you launched the project via the RunExamplesLinux.sh script or by running the built executable directly? The working directory must point to the respective example folder, so for ClothPhysics, this has to be <LLGL-Repository>/examples/Cpp/ClothPhysics.

Also did you try to change the color bits as suggested?

@zhangfq-chemistry
Copy link
Author

If use RunExamplesLinux.sh:
example 4 (triangle)is visible,
example 7 is visible with black viewport

selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
Select example: 2
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
Select example: 3
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
Select example: 4
selected renderer: OpenGL
Renderer: OpenGL 4.6.0 NVIDIA 560.35.03
Device: NVIDIA T400 4GB/PCIe/SSE2
Vendor: NVIDIA Corporation
Shading Language: GLSL 4.60 NVIDIA
Swap Chain Format: RGBA8UNorm
Depth/Stencil Format: Undefined
Resolution: 800 x 600
Samples: 8
Select example: 5
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
Select example: 6
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
Select example: 7
selected renderer: OpenGL
LLGL Renderer: OpenGL Core
Press SPACE to enabled/disable logic fragment operations
Select example: 8
selected renderer: OpenGL
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 46
Current serial number in output stream: 46
......

@LukasBanana
Copy link
Owner

Example 7 (MultiContext) doesn't work correctly in my VM either, but all the other examples do (I have an Ubuntu 24 in VirtualBox with OpenGL 4.1 support only).
Does this error show up with all other example on your machine?
And what if you disable multi-sampling? You can do that by running $ ./RunExamplesLinux.sh -- -ms=0

@zhangfq-chemistry
Copy link
Author

-- -ms=0 is useless. The same error with all other example.

@LukasBanana
Copy link
Owner

Have you tried the source modification I recommended earlier? Can you add this line after ExampleBase.cpp:523:

swapChainDesc.colorBits = 24;

@zhangfq-chemistry
Copy link
Author

Of course.

@LukasBanana
Copy link
Owner

If use RunExamplesLinux.sh:
example 4 (triangle)is visible,

So the HelloTriangle example works on your machine, right? This is the only example that doesn't use a stencil and depth buffer (see Example.cpp:62). Maybe you can try a few different settings in ExampleBase. I would start with depthBits=0 and stencilBits=0 just like in the HelloTriangle example. That would confirm that some wrong X11 framebuffer configuration is selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GL OpenGL specific issue Linux
Projects
None yet
Development

No branches or pull requests

2 participants