8000 3D rendering not working on AMD linux machines. · Issue #800 · bryanedds/Nu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

3D rendering not working on AMD linux machines. #800

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

Open
bryanedds opened this issue Apr 30, 2024 · 5 comments
Open

3D rendering not working on AMD linux machines. #800

bryanedds opened this issue Apr 30, 2024 · 5 comments
Assignees
Labels
bug linux issue relating to linux operating system rendering
Milestone

Comments

@bryanedds
Copy link
Owner
bryanedds commented Apr 30, 2024

EDIT: We spent many months trying to get AMD's opengl drivers to work with our renderer once we switched over to bindless textures. Here's where I landed at before giving up -

i have the exact line in shader code where AMD hangs on light mapping
tho that's on drivers where 3D works at all

vec4 normalPlus = texture(normalPlusTexture, texCoordsOut);

it hangs when trying to sample any of the deferred render buffer textures
i concluded that there is an internal synchronization bug inside the amd opengl driver
something internally goes out of order where sampling a deferred geometry buffer later in the pipeline
i tried putting manual synchronization and guards everywhere relevant to no avail
it's either that or there is a case the bindless texture handle being used gets invalidated internally
it must be internal because there is no legal way for a texture handle to become invalid once it has been made resident without the user making it non-resident
so i conlcuded that it's some internal invalid operation or sequence of operations happening in the driver
the reason i think a workaround might even be slightly possible is because maybe there's some other rendering path that could happen to avoid the internal bug or its preconditions
@bryanedds bryanedds added the investigation a topic involving investigation label Apr 30, 2024
@reinux
Copy link
Collaborator
reinux commented Apr 30, 2024

Did some quick tinkering, and on Linux, it is indeed that easy... maybe.

After exporing MESA_LOADER_DRIVER_OVERRIDE=zink, you can then confirm that it's on Zink by doing glxinfo | grep 'renderer string', which will confirm that it's on Zink.

On my AMD machine, it now crashes without an error message here:

Shader.CreateShaderFromStrs() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Shader.fs:line 34
Shader.CreateShaderFromFilePath() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Shader.fs:line 63
Filter.CreateFilterBoxShader()
GlRenderer3d.make()
RendererInline.Nu.RendererProcess.Start()
WorldModule3.World.tryMake.Static()
WorldModule3.World.run.Static()
Program.main()

Sadly, this isn't as far as it was making it before, which was here:

Gl.GetTextureHandleARB() at /home/rei/.config/JetBrains/Rider2024.1/resharper-host/DecompilerCache/decompiler/414ce548b1474721b05451b5df65cc5022d800/8a/8896862c/Gl.cs:line 25,810
Texture.TryCreateTextureHandle() at /home/rei/oden/home/rei/source/nu/Nu/Nu/OpenGL/OpenGL.Texture.fs:line 373
Texture.CreateTextureHandle()
Framebuffer.TryCreateShadowBuffers()
GlRenderer3d.make()
RendererInline.Nu.RendererProcess.Start()
WorldModule3.World.tryMake.Static()
WorldModule3.World.run.Static()
Program.main()

So we can't be sure if it's an improvement or not, or if this is insurmountable again.

Getting Zink working on Windows seems to be a whole other thing, so I'll have to investigate further.

This is probably a good starting point for getting Zink on windows.

@bryanedds bryanedds changed the title See if we can get our 3D OpenGL implementation to work on AMD with Mesa Zink. See if we can get our 3D OpenGL implementation to work on AMD. Apr 30, 2024
@bryanedds
Copy link
Owner Author

The only reasonable approach remaining was to rip out bindless texture utilization. But it is done and can be tested on other AMD machines.

@bryanedds
Copy link
Owner Author
bryanedds commented Apr 18, 2025

Reopening and renaming this issue because AMD rendering has regressed a while back without us noticing. Even with non-bindless textures, it's still not working in many cases.

The regression seems to have happened around here - c6ffaaf019f48ecc49e309dd76d60b08db428790

UPDATE: At the time of the regression, one thing we did was increase the number of texture slots in use to accommodate more shadows in deferred lighting. This might be one reason that rendering in master no longer works in AMD as perhaps AMD doesn't informally support greater than 32 texture slots like NV seems to.

@bryanedds bryanedds reopened this Apr 18, 2025
@bryanedds bryanedds self-assigned this Apr 22, 2025
@bryanedds bryanedds added bug rendering and removed investigation a topic involving investigation labels Apr 22, 2025
@bryanedds bryanedds changed the title See if we can get our 3D OpenGL implementation to work on AMD. AMD 3D rendering not working on several developer machines. Apr 22, 2025
@bryanedds bryanedds modified the milestones: High Priority, ASAP Apr 22, 2025
@bryanedds bryanedds changed the title AMD 3D rendering not working on several developer machines. AMD 3D rendering not working on several developer linux machines. Apr 26, 2025
@bryanedds
Copy link
Owner Author

UPDATE: now the issue is just in AMD Linux.

@bryanedds bryanedds changed the title AMD 3D rendering not working on several developer linux machines. 3D rendering not working on several developer AMD linux machines. Apr 27, 2025
@bryanedds bryanedds changed the title 3D rendering not working on several developer AMD linux machines. 3D rendering not working on developer AMD linux machines. Apr 28, 2025
@bryanedds bryanedds changed the title 3D rendering not working on developer AMD linux machines. 3D rendering not working on AMD linux machines. Apr 28, 2025
@bryanedds
Copy link
Owner Author

As for bindless textures on AMD, there's this guide - https://gist.icoder.workers.dev/JuanDiegoMontoya/55482fc04d70e83729bb9528ecdc1c61

@bryanedds bryanedds added the linux issue relating to linux operating system label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug linux issue relating to linux operating system rendering
Projects
None yet
Development

No branches or pull requests

2 participants
0