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

If I build it with ptex added, usdview doesn't work. #3456

Closed
minwoojang opened this issue Dec 6, 2024 · 7 comments
Closed

If I build it with ptex added, usdview doesn't work. #3456

minwoojang opened this issue Dec 6, 2024 · 7 comments
Labels
build Build-related issue/PR

Comments

@minwoojang
Copy link

minwoojang commented Dec 6, 2024

Description of Issue

When running usdview with ptex enabled, an ImportError occurs due to an undefined symbol in libusd_hdSt.so. The error message indicates that the function _ZN10OpenSubdiv6v3_6_03Osd21GLSLPatchShaderSource25GetPatchBasisShaderSourceB5cxx11Ev is not found. This issue only occurs when ptex is used; otherwise, usdview runs normally.

Steps to Reproduce

Ensure that ptex support is enabled in the environment.
Run usdview from the command line.
Observe the ImportError related to libusd_hdSt.so.

System Information (OS, Hardware)

OS: Linux (rocky 8.8)
CPU: i7-8700k
RAM: 64GB
GPU: RTX 2060

Package Versions

USD: 24.11
OpenSubdiv:3.6.0
Python: 3.9.16
PySide2: 5.15.2.1
Other related packages: (e.g., libusd_hdSt.so version, etc.)

Build Flags

cmake
${BUILD_PATH}/..
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
-DCMAKE_C_FLAGS="-fPIC"
-DCMAKE_CXX_FLAGS="-fPIC -I/usr/lib64 -I/usr/lib -lGLU -lglut -lGL"
-DCMAKE_POLICY_DEFAULT_CMP0072=NEW
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW
-DCMAKE_VERBOSE_MAKEFILE=ON
-DPXR_BUILD_ALEMBIC_PLUGIN=ON
-DPXR_BUILD_DRACO_PLUGIN=OFF
-DPXR_BUILD_DOCUMENTATION=OFF
-DPXR_BUILD_EMBREE_PLUGIN=OFF
-DPXR_BUILD_IMAGING=ON
-DPXR_BUILD_MATERIALX_PLUGIN=OFF
-DPXR_BUILD_OPENCOLORIO_PLUGIN=ON
-DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON
-DPXR_BUILD_PRMAN_PLUGIN=OFF
-DPXR_BUILD_TESTS=OFF
-DPXR_BUILD_USDVIEW=ON
-DPXR_BUILD_USD_IMAGING=ON
-DPXR_BUILD_USD_CORE=ON
-DPXR_ENABLE_GL_SUPPORT=ON
-DPXR_ENABLE_VULKAN_SUPPORT=OFF
-DPXR_ENABLE_HDF5_SUPPORT=OFF
-DPXR_ENABLE_NAMESPACES=ON
-DPXR_ENABLE_OSL_SUPPORT=OFF
-DPXR_ENABLE_PTEX_SUPPORT=ON
-DPXR_ENABLE_PYTHON_SUPPORT=ON
-DPXR_ENABLE_MATERIALX_SUPPORT=OFF
-DPXR_HEADLESS_TEST_MODE=OFF
-DPXR_STRICT_BUILD_MODE=OFF
-DPXR_VALIDATE_GENERATED_CODE=OFF
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_NO_SYSTEM_PATHS=ON
-DPXR_ENABLE_MULTIVERSE_SUPPORT=OFF
-DPXR_MAYA_TBB_BUG_WORKAROUND=OFF
-DALEMBIC_DIR=${REZ_ALEMBIC_ROOT}
-DGLEW_LOCATION=${REZ_GLEW_ROOT}
-DILMBASE_LOCATION=${REZ_ILMBASE_ROOT}
-DOCIO_LOCATION=${REZ_OCIO_ROOT}
-DOIIO_LOCATION=${REZ_OIIO_ROOT}
-DOPENSUBDIV_ROOT_DIR=${REZ_OPENSUBDIV_ROOT}
-DPTEX_LOCATION=${REZ_PTEX_ROOT}
-DPTEX_INCLUDE_DIR=${REZ_PTEX_ROOT}/include
-DPTEX_LIBRARY=${REZ_PTEX_ROOT}/lib64
-DBOOST_ROOT=${REZ_BOOST_ROOT}
-DBOOST_INCLUDEDIR=${REZ_BOOST_ROOT}/include
-DTBB_ROOT_DIR=${REZ_TBB_ROOT}
-DOPENEXR_LOCATION=${REZ_OPENEXR_ROOT}
-DOPENSUBDIV_INCLUDE_DIR=${REZ_OPENSUBDIV_ROOT}/include
-DOPENSUBDIV_LIBRARIES=${REZ_OPENSUBDIV_ROOT}/lib/
-DOPENSUBDIV_OSDCPU_LIBRARY=${REZ_OPENSUBDIV_ROOT}/lib/libosdCPU.so \

@asluk asluk added the build Build-related issue/PR label Dec 6, 2024
@spiffmon
Copy link
Member

spiffmon commented Dec 6, 2024 via email

@minwoojang
Copy link
Author

Hello? Thank you for your reply. When I checked about opensubdiv, I set the flag as below. And I set it to the rez package. cmake
${BUILD_PATH}/..
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
-DCMAKE_C_FLAGS="-fPIC"
-DCMAKE_CXX_FLAGS="-fPIC"
-DCMAKE_CXX_STANDARD=14
-DUSE_OPEENGL=ON
-DUSE_GLSL=ON
-DUSE_GLFW=ON
-DNO_TESTS=ON
-DNO_EXAMPLES=ON
-DNO_REGRESSION=ON
-DPTEX_LOCATION=${REZ_PTEX_ROOT}
-DTBB_LOCATION=${REZ_TBB_ROOT}
-DZLIB_ROOT=${REZ_ZLIB_ROOT}
-DGLFW_LOCATION=${REZ_GLFW_ROOT}
-DCMAKE_BUILD_TYPE=Release

I built opensubdiv like this. Is there something wrong with the cmake flags?

Will this affect anything? FYI, opensuvdiv is version 3.6.0.

@davidgyu
Copy link
Member

davidgyu commented Dec 7, 2024

That undefined symbol should be resolved by libosdGPU.so which is a distinct library from libosdCPU.so

Does it help if you also specify -DOPENSUBDIV_OSDGPU_LIBRARY=${REZ_OPENSUBDIV_ROOT}/lib/libosdGPU.so in your cmake flags?

Within the OpenSubdiv codebase, Ptex is used only by the examples, there are no dependencies on Ptex within the OpenSubdiv libraries. So, I don't know why enabling Ptex would affect this behavior.

@minwoojang
Copy link
Author

I used chatgpt's comment to add DOPENSUBDIV_OSDGPU_LIBRARY, but after registering this issue, I removed it and did a USD build, so it's the same. If DOPENSUBDIV_OSDGPU_LIBRARY is affected, I don't see anything related to the GPU.
I also thought I should be using the GPU rather than the CPU or both, but I still can't find the cause. Doesn't ptex have any real effect on opensubdiv?

@davidgyu
Copy link
Member

davidgyu commented Dec 7, 2024

Hydra Storm (hdSt) requires both the osdCPU and osdGPU libraries.

Ptex is optional for both OpenUSD and OpenSubdiv.

For OpenSubdiv, Ptex is used only by example code and does not have any effect on the core libraries, i.e. enabling Ptex for the OpenSubdiv build just means that some additional Ptex related examples will be built.

@davidgyu
Copy link
Member

davidgyu commented Dec 7, 2024

The missing symbol is the mangled name for:
OpenSubdiv::v3_6_0::Osd::GLSLPatchShaderSource::GetPatchBasisShaderSource[abi:cxx11]()
which is provided by the osdGPU library when OpenGL is used for the OpenSubdiv build.

Can you check the build logs for your OpenSubdiv build to make sure that OpenGL was found during that build?

Side note: I noticed -DUSE_OPEENGL=ON in your commend above which looks like a typo, but I don't think that specifically should affect the OpenSubdiv build either way.

@minwoojang
Copy link
Author

Previously, ptex was built using rez, but the problem was solved by building without using rez. Now it works normally even if you turn on the ptex supporter. Thank you for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build-related issue/PR
Projects
None yet
Development

No branches or pull requests

4 participants