openmoonray icon indicating copy to clipboard operation
openmoonray copied to clipboard

How to enable Hydra delegate?

Open BrianHanke opened this issue 2 years ago • 28 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

BrianHanke avatar Mar 19 '23 00:03 BrianHanke

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;&"

nospitters avatar Mar 20 '23 15:03 nospitters

...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.

nospitters avatar Mar 20 '23 17:03 nospitters

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.

BrianHanke avatar Mar 20 '23 17:03 BrianHanke

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

nospitters avatar Mar 20 '23 17:03 nospitters

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.

rgwilson68 avatar Mar 20 '23 18:03 rgwilson68

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...

nospitters avatar Mar 20 '23 19:03 nospitters

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?

BrianHanke avatar Mar 20 '23 19:03 BrianHanke

interesting...which houdini version?

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

nospitters avatar Mar 20 '23 19:03 nospitters

'../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 avatar Mar 20 '23 19:03 rgwilson68

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

nospitters avatar Mar 20 '23 19:03 nospitters

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

BrianHanke avatar Mar 20 '23 20:03 BrianHanke

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.

BrianHanke avatar Mar 20 '23 21:03 BrianHanke

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...

nospitters avatar Mar 21 '23 10:03 nospitters

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 avatar Mar 21 '23 12:03 BrianHanke

@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 avatar Apr 10 '23 01:04 panda1100

@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

BrianHanke avatar Apr 10 '23 17:04 BrianHanke

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

panda1100 avatar Apr 10 '23 23:04 panda1100

How did you find this file?

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

BrianHanke avatar Apr 11 '23 00:04 BrianHanke

@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 avatar Apr 11 '23 02:04 panda1100

@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 avatar Apr 11 '23 02:04 BrianHanke

@BrianHanke Thank you!!!

panda1100 avatar Apr 11 '23 02:04 panda1100

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

panda1100 avatar Apr 11 '23 06:04 panda1100

Hi There, Long time Maya user - brand new to Houdini. Are there instructions anywhere for how to import the Dwa shaders into Houdini. Is this through the Hydra plugin? Thanks M

mpjohn avatar Jan 19 '24 13:01 mpjohn

If you have everything included correctly then you should find there are Moonray* Shader HDA's available in the matnet.

You can assign shaders with the LOP material library

golfingmateo avatar Jan 20 '24 01:01 golfingmateo

if the shaders are not showing up make sure you have moved the HDA's into a directory sourced by HOUDINI.

golfingmateo avatar Jan 20 '24 01:01 golfingmateo

Take a look at this: https://docs.openmoonray.org/user-reference/tools/hydra/hdmoonray-houdini/

jlanz avatar Jan 20 '24 01:01 jlanz

Thanks jlanz - that's exactly what I was looking for. After setting up Moonray I thought Houdini setup ( licensing etc ) would be easy...boy was I wrong!

mpjohn avatar Jan 23 '24 16:01 mpjohn

I finally got moonray compiled and working in Houdini (19.5) with the Hydra delegate. The only problem I have is that there are no editable parameters for materials, it looks like the .ds files are not found/used (parameter window empty). I tried to copy files to the Houdini user folder and setting HOUDINI_PATH env var correctly, but both aren't working... RenderSettings node and HdMoonrayRendererPlugin_Viewport are found, though. I also tried to enable houini debug but nothing relevant displayed.

cedricp avatar May 16 '24 08:05 cedricp