SOLVED R23 usd/tbb version

Hello,

R23 usd.module includes a tbb dynamic library.
What is the tbb version compiled?

I'm having a problem loading my own usd dylib, the issue is described in detail here.
One suspicion is that my tbb version is different from Maxon's.

Thanks,
Roger

@rsodre I use statically compiled version of TBB in my own plugins and do not have any problems at all on both windows and OSX.

But you do need to make sure that you are compiling TBB using the exact same compiler version (and on windows the same toolset) otherwise it will not work and you may then have the problems you are seeing.

Use this version of TBB on OSX: https://github.com/wjakob/tbb

It has been updated to allow you to create statically compiled libraries using CMake.

Thanks @kbar ,

We use tbb for a long time and never had problems, only now with usd. I'll try what you say.

I'm not even sure if tbb is the problem, but would be helpful to know which version is used bt Maxon's usd.

Roger

@rsodre do you still have problems if you statically compile TBB? I can see how you would have problems if you tried to load a dylib, since it may try to use the one used by USD and not be compatible. But statically compiling and linking it directly to your own plugin should avoid those problems. It did for me.

Hi Roger, I've checked with our developers and I've been confirmed that our USD uses TBB 2019 u3.

Best, R

Hi,

without further feedback, we will consider this thread as solved by Monday and flag it accordingly.

Cheers,
Ferdinand

This issue is not solved yet.
I'm just disabling customo USD features on R23 for the moment.

I have not tried @kbar suggestion. The TBB team does not recommended to link statically, and my team agrees.

Hi @rsodre,

no worries, I leave the thread open. But I would like to remind you politely, that we would prefer it if separate questions would have separate threads, rather than piling multiple questions all regarding one broader topic in one thread. When there are any questions left about Cinema's TBB version, we would have to ask you to clarify them for us.

Cheers,
Ferdinand

@rsodre can you confirm that even using 2019u3 you still have issue? Have you had any feedback from USD guys?

Cheers, R

@r_gigante yes, I tried that version and no luck as well, but it looks like a USD issue to me.
The USD team didn't give much hope for helping with this.

I've built my usd static library using pxr_Custom as internal namespace to identify on the call stack. This screenshot shows the call stack, looks like it's trying to load C4D's dynamic lib instead of the included static. Thats why I don't think it's tbb issue.

I have the issue isolated on a simple plugin, and if I link to C4D's dynamic usd, instead of our built monolithic static, the simple plugin seems to load and work. I will try to do the same on our environment...

But this will be a super specific ugly exception on the build pipeline. If we could fix and make the plugin use its own included static version of USD would be much easier. The simple plugin is here, if you could check.
To test the project, just run C4D from Xcode and it will freeze loading the plugins.
You can add ../install.sh as a Run Script Phase to fix library paths and deploy. (I wish I could add the Run Script Phase from project tool...😉 )

Hi @rsodre, a quick update from Pixar that hopefully shall address your issue

From: Ivan Kolev [email protected]
Subject: Re: [PixarAnimationStudios/USD] Deadlock loading usd (#1341)
Date: 22 March 2021 at 11:53:37 CET

We resolved this by switching our plugin to refer to the copy of libtbb.dylib included with C4D's USD module, using install_name_tool -change

As our plugin runs on 3 platforms and on 3 hosts (3dsMax/Maya/C4D), our approach to TBB usage is to rely on its full backward compatibility: we compile/link against the oldest version that does the job for us (4.4) and expect that the hosts provide newer versions.
In case of C4D we didn't do that because C4D doesn't include TBB in its main application, though some of its external modules do include their own copy of TBB. Similar to the other modules, we included our (old 4.4) copy of TBB.

But this was no problem until now, the copies of TBB carried by C4D's modules haven't interfered in any harmful way. And the new USD module in R23 didn't change that.

The source of the problem here is probably the fact that our plugin links to our own static copy of USD, which causes USD to be loaded twice, along with two different copies of TBB (and maybe the version mismatch is not important).
So, linking against C4D's copy of TBB resolved the TBB deadlock problem, but we have now a new duplicate symbol problem, which I opened a new issue about: #1479

Cheers, R