LucaScheller / VFX-UsdAssetResolver

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

Windows dependency on Microsoft Visual C++ Redistributable #23

Open dovanbel opened 2 weeks ago

dovanbel commented 2 weeks ago

Hi @LucaScheller

In a previous issue I told you about the CachedResolver crashing Houdini with a segmentation fault. I resolved the issue by re-installing the MS Visual C++ redistributable. I had the same issue again today. I suspect installing an old version of Thinkbox Deadline corrupted the installation, but I'm not certain that this is the cause.

My (noob) question is, could the CachedResolver be compiled for Windows in such a way to avoid this kind of dependency ? We are slowly starting to use it in production and I'm afraid this issue will happen more often as it will be used on more workstations at our studio.

Regards

LucaScheller commented 2 weeks ago

Hey, I can give it a shot again, but this, for me, is too a bit of an unfamiliar territory. The last time I tried it, there were hard to resolve issues due to boost /python.

Since the GitHub runners are also not VFX reference platform compliant, that might explain the .libs problems. Setting that up to be fully compliant is a bit out of the scope of this project, sorry.

You could also try self compiling it. The .bat files in this repo should make it very straight forward, all you need to do is download the MSVC compiler (installing Visual Studio with the C++ packages should do the trick, make sure to install the v142/143 compiler version based on your Houdini version) . If you have issues there, I'd be happy to walk you through it.

Cheers, Luca

dovanbel commented 2 weeks ago

Hi,

I already successfully compiled it following the .bat instructions. I will ask around me if there's any way to get rid of that dependency.

Thanks

LucaScheller commented 2 weeks ago

I did some more research, according to stackoverflow (and chatgpt) statically linking from dynamically linked files (as that is what Houdini ships with), is not straight forward.

Could you share the error again that you are getting? I wonder what specifically is calling into standard clibs that is making it crash.

What happens when you run:

from pxr import Ar
from usdAssetResolver import CachedResolver
dovanbel commented 2 weeks ago

I have not yet managed to reproduce the crash, but here is the log of the crash from a few days ago, when I reported this issue :

Crash report from 800ccaaf; Houdini FX Version 20.5.332 [windows-x86_64-cl19.35]
Uptime 141 seconds
Tue Nov  5 09:23:38 2024
Caught signal 11

Traceback from 16536 ThreadId=0x00004274
CURRENT THREAD 17012
+0x7ff8af792f58 [Thrd_yield] C:\WINDOWS\SYSTEM32\MSVCP140.dll
+0x7ff8000e85f1 [CachedResolverContext::ResolveAndCachePair] \\VSERVER01\shotgun\donatdev2024\install\git\tk-framework-nozonusd.git\v0.1.2\VFX-UsdAssetResolver\CachedResolver_v0.7.3_houdini_20.5.332.py310\lib\cachedResolver.dll
+0x7ff8000e6676 [pxrInternal_v0_24__pxrReserved__::CachedResolver::_Resolve] \\VSERVER01\shotgun\donatdev2024\install\git\tk-framework-nozonusd.git\v0.1.2\VFX-UsdAssetResolver\CachedResolver_v0.7.3_houdini_20.5.332.py310\lib\cachedResolver.dll
+0x7ff89ba904d8 [pxrInternal_v0_24__pxrReserved__::ArResolver::~ArResolver] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_ar.dll
+0x7ff89ba8e0fe [pxrInternal_v0_24__pxrReserved__::ArSplitPackageRelativePathOuter] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_ar.dll
+0x7ff89ba98621 [pxrInternal_v0_24__pxrReserved__::ArResolver::_IsRepositoryPath] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_ar.dll
+0x7ff89ba91c7f [pxrInternal_v0_24__pxrReserved__::ArResolver::Resolve] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_ar.dll
+0x7ff80e40b188 [pxrInternal_v0_24__pxrReserved__::Sdf_ValueTypeNamesType::~Sdf_ValueTypeNamesType] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_sdf.dll
+0x7ff80e55df98 [pxrInternal_v0_24__pxrReserved__::SdfLayer::WriteDataFile] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_sdf.dll
+0x7ff80e551fc1 [pxrInternal_v0_24__pxrReserved__::SdfLayer::FindOrOpen] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_sdf.dll
+0x7ff879c150b4 [pxrInternal_v0_24__pxrReserved__::operator<<] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_pcp.dll
+0x7ff879c1ba91 [pxrInternal_v0_24__pxrReserved__::PcpIsTimeScalingForLayerTimeCodesPerSecondDisabled] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\libpxr_pcp.dll
+0x2d2ec273 [tbb::interface7::internal::task_arena_base::internal_max_concurrency] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x2d2eaf13 [tbb::interface7::internal::task_arena_base::internal_max_concurrency] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x2d2e51a4 [tbb::task_scheduler_init::default_num_threads] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x2d2e476e [tbb::task_scheduler_init::default_num_threads] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x2d2df7b8 [tbb::internal::thread_sleep_v3] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x2d2df73b [tbb::internal::thread_sleep_v3] C:\Program Files\Side Effects Software\Houdini 20.5.332\bin\tbb.dll
+0x7ff8b5a51bb2 [configthreadlocale] C:\WINDOWS\System32\ucrtbase.dll
+0x7ff8b6227374 [BaseThreadInitThunk] C:\WINDOWS\System32\KERNEL32.DLL
+0x7ff8b823cc91 [RtlUserThreadStart] C:\WINDOWS\SYSTEM32\ntdll.dll
dovanbel commented 2 weeks ago

I uninstalled every MS Visual C++ redistributable I had on my pc, rebooted and the CachedResolver is still working (Houdini doesn't crash). So I'm a bit puzzled. Anyway I was raising this issue in case it would be 'trivial' to remove such dependency. But as you say this isn't, then let it be. Lots of other programs are installing those redistributables anyway

Cheers