sideeffects / HoudiniUsdBridge

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.
Apache License 2.0
94 stars 25 forks source link

usdNc plugin load errors #17

Closed nrusch closed 2 years ago

nrusch commented 4 years ago

The usdNc plugin fails to load when using a custom build of this repo, as the lib is not built. This is using the 18.0.416 cut built against the same Houdini version, again with a custom USD library prefix and namespace.

To reproduce, I run hython and then:

import pxr.Usd as usd
usd.Stage.Open('/path/to/some/stage.usd')

When copying the usd_plugins directory to my custom build output, I get a vanilla missing lib error:

Error in 'lpxrInternal__pxrReserved__::PlugPlugin::_Load' at line 248 in file /ssd/rez-build/usd/0.19.11.luma01/src/pxr/base/lib/plug/plugin.cpp : 'Load of '/luma/dev/ruschn/rez-release/usd_houdini_sidefx/18.0.416/platform-linux/gcc-6.3.1/usd-0.19.11.luma01/houdini-18.0.416/houdini/dso/usd/USD_NC.so' for 'usdNc' failed: /luma/dev/ruschn/rez-release/usd_houdini_sidefx/18.0.416/platform-linux/gcc-6.3.1/usd-0.19.11.luma01/houdini-18.0.416/houdini/dso/usd/USD_NC.so: cannot open shared object file: No such file or directory'

When I delete the copied usdNc plugin directory from my custom build output, I get a missing symbol error, due to it trying to load USD_NC.so from the Houdini install tree.

I'm currently experimenting with various ways of preventing USD from trying to load that plugin, but thus far I have not been successful.

marktucker commented 4 years ago

You should specifically not be loading that plugin when using your own USD library. That plugin is used to save and load .usdnc files from Houdini Apprentice. But I'm not really sure how to instruct USD to not load a plugin.

nrusch commented 4 years ago

Yeah, it's being loaded by a vanilla Houdini install as well (when not using a custom build of this repo). I'm not aware of any mechanism to prevent a plugin from being loaded, but I'm asking Pixar.

nrusch commented 4 years ago

It seems I may be able to trick it into working by updating the usdNc plugin's plugInfo.json to look like this:

{
    "Plugins": [
        {
            "Info": {
                "Types": {
                }
            },
            "LibraryPath": "../../usd/USD_Plugins.so",
            "Name": "usdNc",
            "ResourcePath": "resources",
            "Root": "..",
            "Type": "library"
        }
    ]
}
nrusch commented 4 years ago

Hmm. Unfortunately, because the plugin loading is multithreaded (and thus the order is non-deterministic), this isn't a reliable solution.

I'm also getting random failures loading arHFs... it seems sometimes the plugin is loaded from inside of the Houdini install tree and other times it is loaded from my custom build location.

marktucker commented 2 years ago

In 19.0 the libraries were reorganized and instructions provided for building the bridge without overwriting any shipping Houdini libraries, and also how to prevent loading this plugin.