uci-rendering/psdr-cuda

pybind11 error with enoki

Closed this issue · 5 comments

Hello,

I have encountered the error like below, during running the included test code.

Traceback (most recent call last):
  File "psdr_test.py", line 99, in <module>
    process(name, value)
  File "psdr_test.py", line 77, in process
    direct_test(name, args)
  File "psdr_test.py", line 55, in direct_test
    run_orig(integrator, sc, dirname + "/direct_orig.exr", args)
  File "/home/hyeonjang/psdr-cuda/examples/run_test.py", line 28, in run_orig
    img = integrator.renderC(sc, sensor_id)
TypeError: Unable to convert function return value to a Python type! The signature was
        (self: psdr_cuda.Integrator, scene: psdr_cuda.Scene, sensor_id: int = 0) -> enoki::Array<enoki::CUDAArray<float>, 3ul>

I think that there is no pybind11 casting with enoki in the build.
I have installed psdr-cuda in the enviroment Ubuntu 20.04.

Could you give me a help?

This is usually caused by the inconsistent version of the compiler(like GCC) between enoki and psdr_cuda. And you double-check if enoki and psdr_cuda are built using the same compiler with the same version?

Thanks! I found the problem from mitsuba-renderer/enoki#57.
And It was Clang problem in my case.

@hyeonjang could you please clarify what you mean by “It was Clang problem in my case”?

This problem still persists even when compiling enoki and psdr-cuda with exactly the same compiler (clang-9) and stdlib (-stdlib=libc++).

@starbit-coder In my cases, the problem was that I tried to compile the sources with gcc, even if enoki was build by clang.

If you compile the both source in the same setting, there should be no problem.
I recommend to add enoki as a submodule under the "ext" directory and use cmake command "add_subdirectory(/ext)"
And, as you know, there is no specific options about clang in the CMakeLists.txt file. It may be better to compile source with g++.

Thanks for the response @hyeonjang. I've added enoki as a submodule to the psdr-cuda project to try ensure the settings are exactly the same and compiled with g++-9. However, it still gives exactly the same error as in your first post.

Could you maybe provide your CMakeLists.txt for enoki and psdr-cuda?