PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6k stars 1.18k forks source link

PointInstancer: usdview segfault if materials on. If off, Storm performance is very bad. #1507

Open pberto opened 3 years ago

pberto commented 3 years ago

Description of Issue

This not so complex point instanced file exhibits two major issues:

Steps to Reproduce

To repro the crash:

  1. Sim[ply launch usdview: $ python usdview h_instances_flattened.usd

  2. segfaults instantly (assuming you have enable View> Enable Scene Materials on in usdview):

Got keys from plugin meta data ("xcb_glx")
QFactoryLoader::QFactoryLoader() checking directory path "/home/xxx/Development/python-ve/usd20.05-py27/bin/xcbglintegrations" ...
loaded library "/home/xxx/Development/python-ve/usd20.05-py27/lib/python2.7/site-packages/PySide2/Qt/plugins/xcbglintegrations/libqxcb-glx-integration.so"
QFactoryLoader::QFactoryLoader() checking directory path "/home/xxx/Development/python-ve/usd20.05-py27/lib/python2.7/site-packages/PySide2/Qt/plugins/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/xxx/Development/python-ve/usd20.05-py27/bin/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/xxx/Development/python-ve/usd20.05-py27/lib/python2.7/site-packages/PySide2/Qt/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/xxx/Development/python-ve/usd20.05-py27/bin/accessiblebridge" ...
[1]    224354 segmentation fault  python usdview ~/Documents/usd-files/h_instances_flattened.usd

FYI: I get this output because I set export QT_DEBUG_PLUGINS=1

This is what I get when I run this into gdb:

$ gdb python (gdb) run python usdview h_instances_flattened.usd (gdb) bt

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffee4ae96c in void pxr_v21_05__pxrReserved__::(anonymous namespace)::_Dispatch<pxr_v21_05__pxrReserved__::(anonymous namespace)::_BindFunctor, pxr_v21_05__pxrReserved__::HdSt_ResourceBinder const&, bool>(pxr_v21_05__pxrReserved__::HdStShaderCode::NamedTextureHandle const&, pxr_v21_05__pxrReserved__::HdSt_ResourceBinder const&, bool&&) () from /home/xxx/Development/oss-deps/usd-grp/inst/lib/libmvusd_ms.so
#0  0x00007fffee4ae96c in void pxr_v21_05__pxrReserved__::(anonymous namespace)::_Dispatch<pxr_v21_05__pxrReserved__::(anonymous namespace)::_BindFunctor, pxr_v21_05__pxrReserved__::HdSt_ResourceBinder const&, bool>(pxr_v21_05__pxrReserved__::HdStShaderCode::NamedTextureHandle const&, pxr_v21_05__pxrReserved__::HdSt_ResourceBinder const&, bool&&) () from /home/xxx/Development/oss-deps/usd-grp/inst/lib/libmvusd_ms.so
#1  0x00007fffee4aef62 in pxr_v21_05__pxrReserved__::HdSt_TextureBinder::BindResources(pxr_v21_05__pxrReserved__::HdSt_ResourceBinder const&, bool, std::vector<pxr_v21_05__pxrReserved__::HdStShaderCode::NamedTextureHandle, std::allocator<pxr_v21_05__pxrReserved__::HdStShaderCode::NamedTextureHandle> > const&) ()
   from /home/xxx/Development/oss-deps/usd-grp/inst/lib/libmvusd_ms.so

To repro the poor performance:

  1. disable scene materials in usdview, then load the asset (to avoid the crash):
  2. frame the whole asset and start thumbling, you should notice very poor FPS:

image

System Information (OS, Hardware)

This happens on multiple Linux systems, tested on:

Package Versions

Build Flags

        -v \
        -j 24 \
        --alembic \
        --no-test \
        --no-tutorials \
        --no-examples \
        --build-monolithic \
        --build-args \
            USD,"-DCMAKE_CXX_FLAGSAKE_SKIP_BUILD_RPATH=ON
                 -DCMAKE_SKIP_INSTALL_RPATH=ON
                 -DPXR_SET_INTERNAL_NAMESPACE=pxr_v21_05
                 -DPXR_EXTERNAL_NAMESPACE=pxr
                 -DPXR_PYTHON_SHEBANG="/usr/bin/env python2"
                 -DCMAKE_PXR_USE_PYTHON_3=OFF
                 -DTBB_tbb_LIBRARY=${BUILD_FOLDER}/inst-3rd/lib/libtbb-2017_20161004oss.so.2
                 -DTBB_tbbmalloc_LIBRARY=${BUILD_FOLDER}/inst-3rd/lib/libtbbmalloc-2017_20161004oss.so.2
                 -DTBB_tbb_LIBRARY_RELEASE=${BUILD_FOLDER}/inst-3rd/lib/libtbb-2017_20161004oss.so.2
                 -DTBB_tbbmalloc_LIBRARY_RELEASE=${BUILD_FOLDER}/inst-3rd/lib/libtbbmalloc-2017_20161004oss.so.2
            " \
            Alembic,"-DALEMBIC_SHARED_LIBS=OFF" \
            OpenEXR,"-DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=-fPIC" \
            OpenSubdiv,"-DBUILD_SHARED_LIBS=OFF" \
        --src ${BUILD_FOLDER}/src-3rd \
        --build ${BUILD_FOLDER}/build-3rd \
        --inst ${BUILD_FOLDER}/inst-3rd \
        ${BUILD_FOLDER}/inst

Get the file here to repro:

https://www.dropbox.com/s/mh37argjrk9w0e7/h_instances_flattened.usd?dl=1

jilliene commented 3 years ago

Filed as internal issue #USD-6689

pberto commented 3 years ago

Was there any update in 21.08 to alleviate this?

pberto commented 3 years ago

Bump -- I'd appreciate an answer, it takes time to report an issue in a detailed way as above.

c64kernal commented 3 years ago

Hi @pberto -- we appreciate you filing this issue, we unfortunately haven't been able to verify it yet. Once we have some time to investigate it we will be sure to report back here. Thanks for your understanding and patience.

pberto commented 3 years ago

we unfortunately haven't been able to verify it yet.

You mean you did not look into this yet, or you could not reproduce it? Because FYI I just build latest dev branch and both the crash and the very slow performance still happen. Meaning this is obviously not solved in the latest release.

c64kernal commented 3 years ago

Apologies for not being clear, I meant we did not have a chance to look at it yet. Thanks for verifying that it's still an issue in dev. And thanks again for your patience, we're a small team of developers and contribute as much as we can to the community.