dreamworksanimation / openmoonray

MoonRay is DreamWorks’ open-source, award-winning, state-of-the-art production MCRT renderer.

Home Page:https://openmoonray.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to enable Hydra delegate?

BrianHanke opened this issue · comments

Doing good over here, managed to compile MoonRay on a CentOS 7 VM, copied the build over to my main RHEL 8 VM and everything is actually working! (After messing with some libraries.)

Over in Houdini I've got all the MoonRay nodes and parameters showing up in Solaris, but I can't figure out how to enable the Hydra delegate. I tried a bunch of things in houdini.env, but no go. Any tips?

yay
progress

running into the same issue...moonray as a hydra-delegate doesnt show up...
materials and "moonray" parameters show up
using houdini 19.5.435

here how my houdini.env looks like:

REL = "/installs/openmoonray/"

RDL2_DSO_PATH = "$REL/rdl2dso.proxy;$REL/rdl2dso"
MOONRAY_CLASS_PATH = "$REL/shader_json"
ARRAS_SESSION_PATH = "$REL/sessions"

HOUDINI_PATH = "$REL/houdini;$REL/plugin/houdini;&"
PATH = "$REL/bin;$PATH"

PXR_PLUGINPATH_NAME = "$REL/plugin;$REL/plugin/usd;&"

...also messing up with the houdini.env...cant say whats missing...

maybe moonray has to build against houdini usd libraries...dont know if there is an option for that with cmake.

Yeah I was wondering if it needs to be built against Houdini. Also, I have the latest production build installed on my VM, maybe DreamWorks uses an older one?

Would be nice if the build docs included this since I assume 99.9% of us want to use MoonRay in Houdini.

yes, hoping there will be a more detailed instructions for houdini setup/install...
and 99% of the 99.9% wants it in windows 🤪

What I have seen is the Houdini shows MoonRay in the list of renderers if it finds the plugin : if it disappears after you try to switch to that means loading of hdMoonray.so failed, and you can see the error details by clicking on the red warning triangle.

Problems finding the plugin are probably to do with the setting of PXR_PLUGINPATH_NAME : you should have something like this:

echo $PXR_PLUGINPATH_NAME
/installs/openmoonray/scripts/../plugin/usd:
ls /installs/openmoonray/scripts/../plugin/usd
hdMoonray hdMoonrayAdapters moonrayShaderDiscovery moonrayShaderParser plugInfo.json

For libraries that are used by both Houdini and MoonRay, I think you will need to build against the versions that Houdini uses : otherwise hdMoonray.so will find the Houdini versions on LD_LIBRARY_PATH at runtime and may fail to load. The viewport messages in Houdini should show which library was incompatible.

The version of Usd that Houdini uses is available here: https://github.com/sideeffects/USD. It should be possible to build against the actual headers and libraries shipped with Houdini, but you would need a pxrConfig.cmake file to configure Usd properly, and I don't think that is included.

here i see that you also include the ../scripts path to the pxr_pluginpath_name. is that relevant?

houdini doesnt even show up moonray and it doesnt spit out any errors or messages...

from what i can see is that moonray is build with usd 22.05...houdini 19.5 is using usd 22.05a...have the usd versions to match exactly?
https://www.sidefx.com/docs/houdini/news/19_5/platforms.html

edit: and from the changelogs of houdini 19.5 there were several updates on the usd libs, so maybe the usd version is even newer...

That latest production build gives no details on the error, but I tried installing a slightly older version of 19.5 and that one gives a clue:

Hydra: failed to load plugin 'hdMoonray': libusd_usdImaging.so: cannot open shared object file: No such file or directory in '/install/openmoonray/plugin/hdMoonray.so'

I can confirm that libusd_usdImaging.so is indeed not in the plugin folder and is not even anywhere in the openmoonray folders. Should it be?

interesting...which houdini version?

maybe in the installs/lib folder? can remember seeing this somewhere during build...(i am not infront of my VM)

'../scripts' isn't relevant, it's just an artifact of how the setup script works : /installs/openmoonray/plugin/usd would work just as well.

I believe sidefx use their own fork of Usd : I'm not sure if it is completely compatible with vanilla 22.05 or not. libusd_usdImaging.so should be in the 'lib' folder of the built MoonRay release. houdini should have ext/dsolib/libpxr_usdImaging.so, which I believe is the same library under a different name. I'm not sure if they are compatible or not.

There is an env variable you can set before running houdini, to help debug the pxr plugin discovery process:
export TF_DEBUG="PLUG_LOAD PLUG_REGISTRATION PLUG_INFO_SEARCH"

There will be a lot of messages about plugin registration, but among them should be some like this (the beginning of your paths will be different):

Did read plugin info /rel/test/openmoonray/031323_usdview/openmoonray/plugin/usd/plugInfo.json
Globbing plugin info path /rel/test/openmoonray/031323_usdview/openmoonray/plugin/usd/*/
Did read plugin info /rel/test/openmoonray/031323_usdview/openmoonray/plugin/usd/hdMoonray/plugInfo.json
Registering shared library plugin 'hdMoonray' at '/rel/test/openmoonray/031323_usdview/openmoonray/plugin/hdMoonray.so'.

@rgwilson68 @BrianHanke thx for debugging...have to try it out tomorrow...

Thanks for the great info @rgwilson68. Will keep running tests over here.

Well, I sorted through a bunch of viewport errors with all the USD .so files that were missing from the MoonRay build and needed to be symlinked from the "pxr" versions that come with Houdini. That was all working fine, but then I hit this one:

/lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

My VM has openssl1.1.1k and it seems like MoonRay is looking for 1.1.1b? If so, that's the end of the line for me since force installing an older version removes like half my installed packages. Would have to start from scratch with a whole new Linux build.

tried all the recommendations above, also copied the libusd_usdImaging.so (which lives in /usr/local/lib/ in my case) side to hdMoonray.so...but all that desnt help.
i get all above when echo the $PXR_PLUGINPATH_NAME variable...

set the TF_DEBUG="PLUG_*", also installed old houdini 19.5.303 to see if i get any errors, but houdini does not spits anything to the console, and doesnt show the renderer in solaris...
so i give up here and waiting for a maybe function prebuild-release....

thx to everybody...

I think I've finally got it working, but the problem now is that trying to run Houdini on a VM is ultra janky. So, I'd have to install a CentOS 7 dual boot locally. Debating if I want to go to that much trouble...

@BrianHanke Do you have any notes for setting up Houdini + HdMoonRay, by any chance? I don't mind if it's not complete procedures and/or including trial & errors. I have HPC eng. background but super new to rendering and doesn't have Houdini yet 😅 I built MonnRay on Rocky Linux 9 and tested multi node rendering on my local environment so far. Now I'm very curious about real use-case like Houdini + MoonRay.

@panda1100 Yes! I released a build for Houdini 19.5.534 on CentOS 7 here: https://github.com/BrianHanke/openmoonray-bhgc/releases/tag/v2023.4

I also wrote a few guides and articles here: https://github.com/BrianHanke/openmoonray-bhgc/discussions

Thank you @BrianHanke! It will definitely help :)
How did you find this file? https://docs.openmoonray.org/assets/build_extras/moonray_houdini_pxr_config.tar

How did you find this file?

That was shared elsewhere here by Rob Wilson. Would never have figured it out without him!

@BrianHanke I found 2 versions of Houdini installer, what is the difference between the two? python3 version of installer looks smaller than non python3 one.. I'm not sure which one I should use for hdMoonray tests.

houdini-19.5.569-linux_x86_64_gcc9.3.tar.gz 2.3 GB
houdini-py37-19.5.569-linux_x86_64_gcc9.3.tar.gz 2.2 GB

@panda1100 My build was based on houdini-19.5.534-linux_x86_64_gcc9.3.tar.gz. Default Houdini is Python 3.9, but they also offer a 3.7 option.

@BrianHanke Thank you!!!

Well, I sorted through a bunch of viewport errors with all the USD .so files that were missing from the MoonRay build and needed to be symlinked from the "pxr" versions that come with Houdini. That was all working fine, but then I hit this one:

/lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

My VM has openssl1.1.1k and it seems like MoonRay is looking for 1.1.1b? If so, that's the end of the line for me since force installing an older version removes like half my installed packages. Would have to start from scratch with a whole new Linux build.

Houdini has libcrypto.so.1.1 inside dsolib directory. mv libcrypto.so.1.1 libcrypto.so.1.1.bk fix this problem. sudo ln -s /usr/lib64/libnsl.so.2 /usr/lib64/libnsl.so.1 also required on Rocky8 to Houdini works.

https://bugzilla.redhat.com/show_bug.cgi?id=1829790#c9