cpichard / usdtweak

Universal Scene Description standalone editor
Apache License 2.0
228 stars 22 forks source link

Viewport Error When Running USDTweak in Ubuntu 22.04 Hyper-V Environment #15

Closed huming516520 closed 4 weeks ago

huming516520 commented 3 months ago

image

OpenUSD/pxr/imaging/glf/diagnostic.cpp -- GL error: invalid operation, reported from void pxrInternal_v0_24pxrReserved::GlfDrawTarget::Bind()

image diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid operation, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid operation, reported from pxrInternal_v0_24pxrReserved::HgiGLOps::Draw(pxrInternal_v0_24pxrReserved::HgiPrimitiveType, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)::<lambda()> Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid operation, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Runtime Error: in HgiGLPostPendingGLErrors at line 91 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiGL/diagnostic.cpp -- GL error: invalid enum, reported from pxrInternal_v0_24pxrReserved::HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder() Coding Error: in CompositeToInterop at line 310 of /home/dwdtec/workspace/OpenUSD/pxr/imaging/hgiInterop/opengl.cpp -- Failed verification: ' glGetError() == GL_NO_ERROR '

cpichard commented 3 months ago

Hi @huming516520 , thanks for reporting the issue. This is an error related to OpenGL, it's difficult to guess what the problem could be from the error message. What is the OpenGL version and USD version ? Do you have the same issue with usdview or is it working fine? Thanks

Lucas3Dspain commented 3 months ago

I think I was getting something similar in my win laptop. It was related to the Nvidia drivers. I had to force it to use Nvidia high performance processor instead of the integrated graphics(auto)

Idk if this applies to Ubuntu/vms image-3.png

cpichard commented 3 months ago

Hi @Lucas3Dspain , thanks, this is helpful. As this is driver related, this could definitely be the issue on ubuntu as well ! How did you force the app to use the performance driver ?

cpichard commented 3 months ago

It looks like there is an answer here for nvidia GC : https://nvidia.custhelp.com/app/answers/detail/a_id/2615/%7E/how-do-i-customize-optimus-profiles-and-settings

Lucas3Dspain commented 3 months ago

It looks like there is an answer here for nvidia GC : https://nvidia.custhelp.com/app/answers/detail/a_id/2615/%7E/how-do-i-customize-optimus-profiles-and-settings

Did this fix it for you? If you are using hyperV to create a Ubuntu VM, I'm not sure that you can use the GPU from the VM... I was looking at this https://learn.microsoft.com/en-us/answers/questions/1312325/how-to-add-video-card-in-hyper-v-virtual-machine

From my windows vms in hyperV I can't go to the Nvidia control panel for example, and in the list of devices I can't see my Nvidia GPU (inside the VM)

cpichard commented 1 month ago

Hi, I found this discussion regarding using high performance gpu on multi gpu systems : https://stackoverflow.com/questions/16823372/forcing-machine-to-use-dedicated-graphics-card I have added the 2 global variables that should trigger the use of the dedicated gpu. Hopefully it should solve this issue, if it was caused by that. Let me know as I don't have access to laptops with nvidia/amd gpus.

cpichard commented 4 weeks ago

Hi @huming516520 , @Lucas3Dspain, there is a new release which should hopefully works better, it selects the dedicated graphic card if there is one, and choose the opengl version needed by storm https://github.com/cpichard/usdtweak/releases/tag/2024.07.20-prealpha

cpichard commented 4 weeks ago

Closing this issue now, feel free to re-open it if needed.