LucaScheller / VFX-UsdAssetResolver

Usd Asset Resolver Reference Implementations
https://lucascheller.github.io/VFX-UsdAssetResolver/
Apache License 2.0
104 stars 21 forks source link

Cacheresolver crashes when Davinci resolve is installed #18

Open kreppene opened 1 week ago

kreppene commented 1 week ago

Im running in to a really strange problem. The cache resolver works fine in houdini 20.5 on our windows machines, but if davinci resolve is installed on the machine, it crashes houdini. This does not happen in houdini 20.

We are using Davinci Resolve 19. and houdini 20.5.278

Any idea how to get around this problem?

This is the Traceback


15148: Fatal error: Segmentation fault
-- TRACEBACK BEGIN --
Traceback from karma 20.5.278 (Compiled on windows-x86_64-cl19.37):
CURRENT THREAD 15496
+0x7ffe35da3028 [Thrd_yield] C:\windows\SYSTEM32\MSVCP140.dll
+0x7ffd708285f1 [CachedResolverContext::ResolveAndCachePair] C:\pipeline\plugins\houdini\Packages\assetResolver_07.3_20.5\cachedResolver\lib\cachedResolver.dll
+0x7ffd70826676 [pxrInternal_v0_24__pxrReserved__::CachedResolver::_Resolve] C:\pipeline\plugins\houdini\Packages\assetResolver_07.3_20.5\cachedResolver\lib\cachedResolver.dll
+0x7ffe1a8303e1 [pxrInternal_v0_24__pxrReserved__::ArResolver::~ArResolver] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_ar.dll
+0x7ffe1a82e0fe [pxrInternal_v0_24__pxrReserved__::ArSplitPackageRelativePathOuter] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_ar.dll
+0x7ffe1a838621 [pxrInternal_v0_24__pxrReserved__::ArResolver::_IsRepositoryPath] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_ar.dll
+0x7ffe1a831c7f [pxrInternal_v0_24__pxrReserved__::ArResolver::Resolve] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_ar.dll
+0x7ffd8aa1b188 [pxrInternal_v0_24__pxrReserved__::Sdf_ValueTypeNamesType::~Sdf_ValueTypeNamesType] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_sdf.dll
+0x7ffd8ab6df98 [pxrInternal_v0_24__pxrReserved__::SdfLayer::WriteDataFile] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_sdf.dll
+0x7ffd8ab61fc1 [pxrInternal_v0_24__pxrReserved__::SdfLayer::FindOrOpen] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_sdf.dll
+0x7ffd8c5659fd [pxrInternal_v0_24__pxrReserved__::PcpTranslateTargetPathFromRootToNode] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x7ffd8c57a805 [pxrInternal_v0_24__pxrReserved__::PcpPrimIndex::Swap] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x7ffd8c56d11f [pxrInternal_v0_24__pxrReserved__::PcpIsNewDefaultStandinBehaviorEnabled] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x7ffd8c56ca20 [pxrInternal_v0_24__pxrReserved__::PcpComputePrimIndex] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x7ffd8c50bec8 [pxrInternal_v0_24__pxrReserved__::PcpCache::UsesLayerStack] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x7ffd8c5103cc [pxrInternal_v0_24__pxrReserved__::PcpCache::_ForEachPrimIndex] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\libpxr_pcp.dll
+0x1e41c273 [tbb::interface7::internal::task_arena_base::internal_max_concurrency] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x1e41af13 [tbb::interface7::internal::task_arena_base::internal_max_concurrency] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x1e4151a4 [tbb::task_scheduler_init::default_num_threads] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x1e41476e [tbb::task_scheduler_init::default_num_threads] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x1e40f7b8 [tbb::internal::thread_sleep_v3] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x1e40f73b [tbb::internal::thread_sleep_v3] C:\Program Files\Side Effects Software\Houdini 20.5.278\bin\tbb.dll
+0x7ffe49d99333 [recalloc] C:\windows\System32\ucrtbase.dll
+0x7ffe4a6b257d [BaseThreadInitThunk] C:\windows\System32\KERNEL32.DLL
+0x7ffe4c3caf28 [RtlUserThreadStart] C:\windows\SYSTEM32\ntdll.dll
OTHER THREAD 25048
LucaScheller commented 1 week ago

Hey, sorry not sure what is causing this. Is DaVinci installing any system libs? I'll try to find some time over the weekend to replicate the issue.

LucaScheller commented 1 week ago

Can you try running:

from pxr import Ar
from usdAssetResolver import CachedResolver

And see if there is an error message? (Python + system console)

kreppene commented 1 week ago

Hi Luca, thank you so much for helping me out.

this is what i get when running the code abov. >>> from usdAssetResolver import CachedResolver Traceback (most recent call last): File "<console>", line 1, in <module> File "C:\Program Files\Side Effects Software\Houdini 20.5.278\python310\lib\site-packages-forced\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import return original_import(name, *args, **kwargs) File "c:\plugins\houdini\Packages\assetResolver_07.3_20.5\cachedResolver\lib\python\usdAssetResolver\CachedResolver\__init__.py", line 2, in <module> Tf.PreparePythonModule() File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.278\python310\lib\site-packages\pxr\Tf\__init__.py", line 103, in PreparePythonModule module = importlib.import_module( File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.278\python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed while importing _cachedResolver: The specified module could not be found.

Do you think we could get around this problem if i compile the resolver staticly?

Lett me know if you need anything else.

LucaScheller commented 6 days ago

Hey, so I think compiling the resolver yourself here is our best bet. I am assuming that Davinci installs some system libs for compatiblity and that is some how messing with the build. Is Davinci changing the PATH environment variable, maybe that is messing the libs?

We had a similar issue here on linux https://github.com/LucaScheller/VFX-UsdAssetResolver/issues/14#issuecomment-234719647 The problem is, since the GitHub runners are not VFX Reference platform compliant, we might run into these kinds of issues, since the runners likely use newer libs. Building statically with boost/python doesn't seem to be as straight forward as expected (at least it didn't work for me out of the box).

Compiling yourself in this case should be straight forward, all you need to do is install Visual Studio (and the Visual Studio build tools) and run the build.bat in the root of this repo (see the comment lines on what to configure).

Sorry that I can't be of more help here, it is hard to inspect/debug without having access to the machine.

kreppene commented 5 days ago

No worries Luca, thanks for looking into it.
I tried to build it my self, but its still causing the same crash. Also tried looking into the PATH var to se i could find any "suspec" path, but still no luck. I will explore a few other possible solution, if not we jut have to wipe the machine.

I think you can close this ticket, and just lett you know if i find a solution.

Cheers Luca :)