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

Open3D Visualizer fails to start when running the standard python test code (AMD GPU) #4852

Open
3 tasks done
dnjiang opened this issue Mar 6, 2022 · 32 comments
Open
3 tasks done

Comments

@dnjiang
Copy link

dnjiang commented Mar 6, 2022

Checklist

Steps to reproduce the issue

Install Open3D using pip on python3.8.10 embedded. Then run the test code below (which is copied from the installation page http://www.open3d.org/docs/release/getting_started.html):

python -c "import open3d as o3d; \
           mesh = o3d.geometry.TriangleMesh.create_sphere(); \
           mesh.compute_vertex_normals(); \
           o3d.visualization.draw(mesh, raw_mode=True)"

The last line will fail as detailed in the Error Message section below.

Error message

C:\Python-3.8.10-embed>python -c "import open3d as o3d;mesh = o3d.geometry.TriangleMesh.create_sphere();mesh.compute_vertex_normals();o3d.visualization.draw(mesh, raw_mode=True)"
FEngine (64 bits) created at 0000014F53CF2050 (threading is enabled)
FEngine resolved backend: OpenGL

in void __cdecl filament::PlatformWGL::makeCurrent(struct filament::backend::Platform::SwapChain *,struct filament::backend::Platform::SwapChain *) noexcept:241
reason: wglMakeCurrent() failed. hdc = 000000006B0117E0

Windows error code: 2000. (null)
COMPILE ERROR:

1:   #version 410
2:   layout(std140) uniform FrameUniforms
3:   {
4:   mat4 viewFromWorldMatrix;
5:   mat4 worldFromViewMatrix;
6:   mat4 clipFromViewMatrix;
7:   mat4 viewFromClipMatrix;
8:   mat4 clipFromWorldMatrix;
9:   mat4 worldFromClipMatrix;
10:   mat4 lightFromWorldMatrix[4];
11:   vec4 cascadeSplits;
12:   vec4 resolution;
13:   vec3 cameraPosition;
14:   float time;
15:   vec4 lightColorIntensity;
16:   vec4 sun;
17:   vec3 lightPosition;
18:   uint padding0;
19:   vec3 lightDirection;
20:   uint fParamsX;
21:   vec3 shadowBias;
22:   float oneOverFroxelDimensionY;
23:   vec4 zParams;
24:   uvec2 fParams;
25:   vec2 origin;
26:   float oneOverFroxelDimension;
27:   float iblLuminance;
28:   float exposure;
29:   float ev100;
30:   vec3 iblSH[9];
31:   vec4 userTime;
32:   float iblRoughnessOneLevel;
33:   float cameraFar;
34:   float refractionLodOffset;
35:   uint directionalShadows;
36:   vec3 worldOffset;
37:   float ssContactShadowDistance;
38:   float fogStart;
39:   float fogMaxOpacity;
40:   float fogHeight;
41:   float fogHeightFalloff;
42:   vec3 fogColor;
43:   float fogDensity;
44:   float fogInscatteringStart;
...

Open3D, Python and System information

- Operating system: Windows 10 64-bit
- Python version: Python 3.8.10 / 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
- Open3D version: output from python: `print(open3d.__version__)`
- System architecture: arm64
- Is this a remote workstation?: no. It is a desktop with Ryzen 5950x and Radeon HD 7950.
- How did you install Open3D?: pip
- Compiler version (if built from source): n/a

Additional information

No response

@dnjiang dnjiang added the build/install Build or installation issue label Mar 6, 2022
@yxlao
Copy link
Collaborator

yxlao commented Mar 7, 2022

I am not familiar with Python "embedded". Did you try a regular Python distribution, e.g. from conda?

@dnjiang
Copy link
Author

dnjiang commented Mar 8, 2022

Same issue with MiniConda 3.8 installed from the link you gave.

I also built Open3DViewer in VS2019 and got a similar error on wglMakeCurrent:
FEngine (64 bits) created at 000001525603D080 (threading is enabled)
FEngine resolved backend: OpenGL
ATI Technologies Inc., AMD Radeon HD 7900 Series, 4.1.14831 Core Profile Forward-Compatible Context 21.5.2 27.20.20903.8001, 4.60
OS version: 0
class utils::PostconditionPanic
in void __cdecl filament::PlatformWGL::makeCurrent(struct filament::backend::Platform::SwapChain *,struct filament::backend::Platform::SwapChain *) noexcept:241
in file D:\a\filament\filament\filament\backend\src\opengl\PlatformWGL.cpp
reason: wglMakeCurrent() failed. hdc = FFFFFFFFD8012A6A

And also I got a visual assert:
image

It seems that Open3D is not compatible with the Radeon HD 7950 video card ?

@LIHU577
Copy link

LIHU577 commented Mar 9, 2022

I meet a same question when I build it on window recently.....so how to fixed it?
image

@dnjiang
Copy link
Author

dnjiang commented Mar 10, 2022

The issue reported by LIHU557 also happens on an AMD video card. Wonder if Open3D Visualizer/Viewer does not even support AMD video cards at all on Windows.

Anyone has issues with Open3D Visualizer/Viewer on Windows using a NVidia card? Maybe Open3D Visualizer/Viewer does not support Windows at all?

Update: I tried this on a Windows 10 machine with a NVidia video card, it works. So this pretty much confirm that the issue is very likely specific to AMD video cards.

@dnjiang
Copy link
Author

dnjiang commented Mar 11, 2022

Update: this seems to be a known issue in filament and there could be a workaround(?):
google/filament#1921

@dnjiang
Copy link
Author

dnjiang commented Mar 11, 2022

Anyone has a clue? This bug makes the whole Open3D not usable at all on AMD and (some) intel video cards.

@ssheorey ssheorey added visualization windows and removed build/install Build or installation issue labels Mar 13, 2022
@assafkeller
Copy link

I had the same problem, I set Nvidia Vcard as default and it solved it.

@dnjiang
Copy link
Author

dnjiang commented Mar 19, 2022

How do you set it? Are you saying that you are on an AMD or Intel card, but you programmatically tell Open3D that you are on a NVidia card instead?

@LIHU577
Copy link

LIHU577 commented Mar 19, 2022

set dedicated video card rather than a core card as default card, if you use AMD CPU ,you can google it ,and see how to change default card on windows . then I perfect run it. The reason I guess is that the OpenGL which core card implement has compatibility question
image

@LIHU577
Copy link

LIHU577 commented Mar 19, 2022

a common operation is open Nvidia setting panel on windows --->manage 3D settings--->OpenGL render GPU --->then choose the card you want. image
by do that,I have compile it successfully with no error
emm.....maybe useful for you ,maybe not,,hh,it's so troubling

@dnjiang
Copy link
Author

dnjiang commented Mar 19, 2022

@LIHU577, based on your screenshot, you do NOT have an AMD video card and since you have an NVidia card, you do not even need to set the video card type and Open3D would just work.

The issue I reported is that Open3D Viewer cannot run on a PC with an AMD video card. So I do not think your suggestion would help unless I am missing something here.

@hydraslay
Copy link

Same here while running origin sample code.
My GPU is AMD Radeon RX 6700XT.
But it displayed very well when I changed "o3d.visualization.draw" to "o3d.visualization.draw_geometries".

@AutomationIntegration
Copy link

AutomationIntegration commented May 18, 2022

Thank you for posting this! I have hit the exact same error, on a computer that uses an AMD Ryzen 5 5600G CPU (or technically APU, as the graphics processing is embedded) and does not use a discrete GPU. But, the same program runs correctly on a computer that has an Intel CPU and Nvidia GPU.

Does anyone know if an Intel CPU with embedded graphics (so, an APU), without a discrete GPU, will hit this problem? I wish to run my Open3D program from a very compact desktop, and thus I would prefer to not use a discrete GPU.

@julienguegan
Copy link

Same error here with an AMD Radeon Vega 8 Graphics, if someone has a solution I like to hear it ! (I tried to desactivate the device in the device manager but same error appears)

@lakshya-4gp
Copy link

same error here, any updates on this.

@chungvmo
Copy link

i have same error on my laptop using AMD 5800H CPU

@easilylazy
Copy link

i have same error on my laptop using AMD 5800H CPU

same here

@v479038280
Copy link

i have same error on my laptop using AMD 5800H CPU

same here

same too

@ssheorey ssheorey changed the title Open3D Visualizer fails to start when running the standard python test code Open3D Visualizer fails to start when running the standard python test code (AMD GPU) Jul 1, 2023
@ResiduaLiu
Copy link

2023 still no solution??

@Thanatossan
Copy link

Thanatossan commented Oct 31, 2023

have solution yet?

@v479038280
Copy link

change a computer may be a easy solution to solve it

@danrauch
Copy link
Contributor

danrauch commented Nov 16, 2023

I have the same wglMakeCurrent() failed error with an AMD Ryzen 7940HS and 5625U on Windows 10 22H2 (Open3D 17.0) when calling o3d.visualization.draw.

Edit: Tested also 0.18, the current dev build and another GPU (Radeon Pro W7900), with the same result.

Some more info:

  • When using native Linux or a Linux Virtual Machine everything works as expected (Ubuntu 22.04; Mesa 23.0).
  • When trying to use the Windows builds of Mesa (also 23.0) the error changes to wglCreateContextAttribs() failed (I tried "d3d12" & "zink"). Weird, as Mesa works with Linux...

@nirmalsnair
Copy link

a common operation is open Nvidia setting panel on windows --->manage 3D settings--->OpenGL render GPU --->then choose the card you want. image
by do that,I have compile it successfully with no error
emm.....maybe useful for you ,maybe not,,hh,it's so troubling

Screenshot 2024-01-17 135744

This worked for me!
Mine is an AMD Ryzen 7945HX CPU (with Radeon 610M integrated graphics) and an NVIDIA RTX 4090 GPU.

@KomischerName
Copy link

So there is still no way to use AMD graphics on Windows?

@danrauch
Copy link
Contributor

Same here while running origin sample code. My GPU is AMD Radeon RX 6700XT. But it displayed very well when I changed "o3d.visualization.draw" to "o3d.visualization.draw_geometries".

This works fine for now, so in general open3d is usable on Windows on AMD.

But no, the normal draw() ui is still not working, possibly due to a bug in the filament dependency. I'm really hoping this pull can fix it: #6511

@rroell
Copy link

rroell commented Jan 26, 2024

I also have this issue on my AMD Ryzen 5 Pro 7540U.

@x1y9
Copy link

x1y9 commented Mar 11, 2024

I have the same issue with a Radeon 780M GPU.

@greendolph1n
Copy link

same issue 6800M AMD gpu

@Gilabite
Copy link

Gilabite commented May 4, 2024

same issue win11 7900XTX

@vmoyu
Copy link

vmoyu commented May 27, 2024

same issue win11 4800H APU

@buranberk
Copy link

same issue win10 rx580 gpu

@mxagar
Copy link

mxagar commented Oct 15, 2024

Same issue here

  • Python 3.11.9
  • Open3D 0.18.0
  • Microsoft Windows 11 Enterprise
  • AMD Ryzen 5 PRO 5675U with Radeon Graphics, 2301 Mhz, 6 Core(s), 12 Logical Processor(s)

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

No branches or pull requests