ERROR: Initialization of MDL SDK failed: libmdl_sdk.so not found or wrong version.
Closed this issue · 3 comments
Hi!
I encountered an error while running this example:
./MDL_renderer - s system mdl hair. txt - d scene mdl hair. txt
Arena size=128 MiB
OpenGL interop=1
LoadSceneDescription(), m1idGroup=1, m1idInstance=3, m1idGeometry=3
CUDA Driver Version=12.2
CUDA Device Count=1
Device ordinal 0: NVIDIA GeForce RTX 2060 visible
Device ordinal 0: 5469437952 bytes free; 6191251456 bytes total
Device ordinal 0: NVIDIA GeForce RTX 2060 selected as active device index 0
1 peer-to-peer island: (0)
Error: dlopen (libmdl-sdk. so, RTLD-LAZY) failed with error code libmdl-sdk. so: cannot open shared object file: No such file or directory
Error: Initialization of MDL SDK failed: libmdl_sdk.so not found or wrong version
Error: Application () Could not initialize MDL
Error: Application () failed to initialize successfully
I have copied the libmdl_sdk.so dds.so file from MDL,to the MDL_renderer executable.
It seems that there is no nv_openimageio.so in Ubuntu, so I copied libOpenImageIO.so
Ubuntu20.04
optix version:7.7
MDL version: 2023.1.3
OpenImageIO version:2.4.14.0
1.) I'm confused by the dlopen error message. Why is there a space in libmdl-sdk. so
and why is it named libmdl-sdk
and not libmdl_sdk
?
Can you debug through the code at
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/MDL_renderer/src/Raytracer.cpp#L1437
and see what is happening there?
2.) nv_openimageio
is built by the MDL SDK. That is the name used to load the plugins here: https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/MDL_renderer/src/Raytracer.cpp#L1640
You cannot simply copy any other random OpenImageIO library and expect that to be used and work.
Did you build the MDL SDK from the open-source repository https://github.com/NVIDIA/MDL-SDK or did you use the pre-built binary version?
If you built it yourself, did the CMake generated project have MDL_BUILD_OPENIMAGEIO_PLUGIN enabled?
Please follow the MDL SDK build instructions inside its INSTALL.md exactly.
I'm using the same methods as the MDL SDK examples to load the dynamic libraries.
Do the CUDA or OptiX examples inside the MDL SDK work on your system?
These must work or something is wrong in your development environment.
3.) If you cannot get the nv_openimageio library to build and work, the above Raytracer.cpp code can also load the nv_freeimage library. Building that inside the MDL SDK is disabled by default so that must be enabled explicitly via MDL_BUILD_FREEIMAGE_PLUGIN.
Switching between the two nv_openimageio and nv_freeimage libraries is done with the USE_OPENIMAGEIO_PLUGIN in
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/MDL_renderer/shaders/config.h#L87
(I would recommend you try getting the nv_openimageio code path to work though.)
- I will first check why is it named libmdl-sdk and not libmdl_sdk?
- I built the MDL SD myself, I will recheck the build options,CUDA and OptiX examples inside the MDL SDK are working fine.
Maybe I will try to use the pre-built binary version later.
Thank you very much
I solved this problem.
1)ibmdl_sdk was renamed to ibmdl-sdk because the clipboard caused a format change.
2)I used the MDL of the pre-built binary, but the dlopen error still occurred.
3)the dlopen's declaration look like, void *dlopen(const char *filename, int flag);
if you set the para 'filename' as shared library's name , you should add you current path into the 'LD_LIBRARY_PATH'.for instance,
1, dlopen("libtest.so" , RTLD_LAZY)
2, in shell , export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
And the problem solved.
Thank you very much.