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

Link Error for dxPtexViewer on Windows #1328

Open
jonassorgenfrei opened this issue Mar 10, 2024 · 3 comments
Open

Link Error for dxPtexViewer on Windows #1328

jonassorgenfrei opened this issue Mar 10, 2024 · 3 comments

Comments

@jonassorgenfrei
Copy link

Hey

I'd like to reopen this ticket as i still having this issue unfortunatly.
I just tried to build the library and again hang at building dxPtexViewer.
Are there any solutions to this yet.

It's still the linking issue for dxPtexViewer which can't resolve the symbols:

public: void __cdecl OpenSubdiv::v3_6_0::Osd::CLD3D11VertexBuffer::UpdateData(float const *,int,int,struct _cl_command_queue *)
public: struct _cl_mem * __cdecl OpenSubdiv::v3_6_0::Osd::CLD3D11VertexBuffer::BindCLBuffer(struct _cl_command_queue *)
public: struct ID3D11Buffer * __cdecl OpenSubdiv::v3_6_0::Osd::CLD3D11VertexBuffer::BindD3D11Buffer(struct ID3D11DeviceContext *)
public: static class OpenSubdiv::v3_6_0::Osd::CLD3D11VertexBuffer * __cdecl OpenSubdiv::v3_6_0::Osd::CLD3D11VertexBuffer::Create(int,int,struct _cl_context *,struct ID3D11DeviceContext *)

Here's my CMake config:
grafik

Thanks for you help in advance :)

Cheers
Jonas

Originally posted by @jonassorgenfrei in #1154 (comment)

@davidgyu
Copy link
Member

Filed as internal issue #OSD-435

@davidgyu
Copy link
Member

Sorry to hear that you're still having this issue. Seems like something is misconfigured in your CMake config.

In general, the same configuration which allows dxPtexViewer.exe to be built with support for D3D11 OpenCL interop is the configuration that enables building osd/clD3D11VertexBuffer.cpp which provides the symbols which are undefined in your build.

How are you running CMake, i.e. from the command prompt, from within Visual Studio, etc.?

I typically run CMake from the command prompt and then open the resulting solution in Visual Studio, or just build from the command prompt, e.g.:

set OpenCL_LIBPATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\lib\x64

cmake^
-S .^
-D buildDir^
-G "Visual Studio 17 2022" -A x64^
-D CMAKE_INSTALL_PREFIX="buildDir/inst"^
-D PTEX_LOCATION:path="%USERPROFILE%/3rdparty/ptex-2.1.28/build"^
-D ZLIB_ROOT:path="%USERPROFILE%/3rdparty/zlib-1.2.11/build"^
-D CUDA_TOOLKIT_ROOT_DIR:path="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.0"^
-D OpenCL_ROOT:path="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.0"^
-D NO_OPENGL:bool=ON^
-D NO_OPENCL:bool=OFF^
-D NO_OMP:bool=ON^
-D NO_CLEW:bool=ON^
-D NO_TBB:bool=ON^
-D NO_DOC:bool=ON^

cmake --build buildDir --config Release --target install

.\buildDir\bin\Release\dxViewer.exe

Another thing I noticed in your CMake config is that you apparently have two different OpenCL toolkits installed: NVIDIA's CUDA 12 Toolkit and another in OpenCL-SDK (possibly from Intel or AMD or Khronos?). I don't know if that's a problem, but you might try explicitly pointing to the OpenCL implementation in NVIDIA's SDK as in my example above.

@davidgyu
Copy link
Member

We haven't been able to reproduce this. Are you still hitting this problelm?

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