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

Black Viewport on Linux #20

Open
ScatteredRay opened this issue Sep 7, 2024 · 4 comments
Open

Black Viewport on Linux #20

ScatteredRay opened this issue Sep 7, 2024 · 4 comments

Comments

@ScatteredRay
Copy link
Contributor

I'm getting a black viewport running on Linux. Initially, I found that pxr/garch doesn't support EGL, and can't capture the context on wayland. But forcing to run under XWayland, I get a black viewport.

SS-2024+07+09-12-44-841746933

Here is my console output:

Settings: /home/indy/.usdtweak_gui.ini
AMD
AMD Radeon RX 6800 XT (radeonsi, navi21, LLVM 18.1.8, DRM 3.54, 6.6.45)
OpenGL 4.6 (Compatibility Profile) Mesa 24.1.5
GLSL 4.60
USD 2405
glxContext: 0x21f2f40
PXR_PLUGINPATH_NAME:
rawContext1
Reading blueprints
Blueprints ready
Warning: In image "/home/indy/dev/RenderWitch/assets/venice_sunrise_4k.exr" mip level 1 does not exist [usdtweak]

I tried a capture from RenderDoc, and don't seem to see any element from the scene in the capture.
SS-2024+07+09-12-41-382066823

Any thoughts on things I could do to start to diagnose this issue?

@cpichard
Copy link
Owner

cpichard commented Sep 8, 2024

Hi @ScatteredRay , thanks for the bug report.
I have seen similar issues previously, the one I had been able to repro was fixed by updating the drivers, it was on an intel integrated graphic card. I am not sure about amd cards, but I would say the first thing I would do is make sure the drivers are the latest one. On the amd web site I see the drivers are 24.x.x and here the log reports 6.x.x, may be updating them could fix the issue ?

Then I would start checking if usdview works or has the same issue. usdview is pretty similar to usdtweak in terms of viewport rendering, so if usdview works and usdtweak doesn't then it has likely to do with opengl code. In that case I would look for opengl errors at each calling site with a debugger or whatever works to instrument the calls.

Hope that helps, unfortunately I don't have a similar setup around to debug, I'll ask around see if I can find that.
Thanks

@ScatteredRay
Copy link
Contributor Author

I think 6.x.x is the Radeonsi version, because I don't think my drivers are that out of date. I could try the proprietary drivers, but usdview, and all other instances of hdStorm seem to run fine on my local machine. So it seems like it should be possible to get usdtweak to do the same.

Do you have some likely cullprits to start with as far as calling sites go?

Thanks,
Indy

@cpichard
Copy link
Owner

cpichard commented Sep 9, 2024

Are storm and usdview coming from the same usd libs usdtweak is compiled with ? If so, you are right, usdtweak should be working as well. I would first try to recompile usd with embree and check if embree is working or not as this would highlight if this is a problem with storm of the thin layer used in ut to pass the hydra render to imgui.
There are few sites that are interesting to check:
To start Hydra rendering is launched here

editor.HydraRender(); // RenderViewports

and the UI drawing is done here:

editor.Draw();

When a viewport is created, it creates an OpenGL buffer here (a DrawTarget):

_drawTarget = GlfDrawTarget::New(_textureSize, false);

I have seen that the bit depth of the attachement might not be compatible on old cards, but that's unlikely in your case as you have a recent card, might worth checking though

The Render function is where hydra renders in the DrawTarget:

void Viewport::Render() {

It follows what usdview is doing almost line by line.
I would probably start by commenting as much code as possible and leave the glClearColor with a different color, to check if the opengl buffer is correctly displayed. Then look for errors ...

Then utimaltely the UI draws the drawtarget on the display here:

ImGui::Image((ImTextureID)((uintptr_t)_textureId), ImVec2(_textureSize[0], _textureSize[1]), ImVec2(0, 1), ImVec2(1, 0));

Hope that helps, let me know if I can help further

C

@ScatteredRay
Copy link
Contributor Author

Yeah, same usd libs for both usdtweak, and usdview.

Additionally, already tried embree, it works in usdview, but not in usdtweak.

Thanks for the recommendations.

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

No branches or pull requests

2 participants