Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBB deprecated atomics #887

Closed
frispete opened this issue Nov 27, 2020 · 12 comments
Closed

TBB deprecated atomics #887

frispete opened this issue Nov 27, 2020 · 12 comments

Comments

@frispete
Copy link

Just a heads up, TBB complains:

[  238s] cd /home/abuild/rpmbuild/BUILD/blender-2.91.0/build/intern/cycles/kernel/shaders && /usr/bin/oslc -q -O2 -I"/home/abuild/rpmbuild/BUILD/blender-2.91.0/intern/cycles/kernel/shaders" -I"OSL_SHADER_DIR-NOTFOUND" -o /home/abuild/rpmbuild/BUILD/blender-2.91.0/build/intern/cycles/kernel/shaders/node_separate_rgb.oso /home/abuild/rpmbuild/BUILD/blender-2.91.0/intern/cycles/kernel/shaders/node_separate_rgb.osl
[  238s] In file included from /usr/include/openvdb/tree/LeafBuffer.h:10,
[  238s]                  from /usr/include/openvdb/tree/LeafNode.h:11,
[  238s]                  from /usr/include/openvdb/tree/Tree.h:18,
[  238s]                  from /usr/include/openvdb/Grid.h:12,
[  238s]                  from /usr/include/openvdb/openvdb.h:12,
[  238s]                  from /home/abuild/rpmbuild/BUILD/blender-2.91.0/intern/openvdb/intern/openvdb_transform.h:23,
[  238s]                  from /home/abuild/rpmbuild/BUILD/blender-2.91.0/intern/openvdb/intern/openvdb_transform.cc:20:
[  238s] /usr/include/tbb/atomic.h:21:141: note: '#pragma message: TBB Warning: tbb/atomic.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.'
[  238s]    21 | #pragma message("TBB Warning: tbb/atomic.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")

openvdp 7.1.0
TBB 2020.3

@Idclip
Copy link
Contributor

Idclip commented Jan 12, 2021

Thanks @frispete, we're aware of this and are working on a fix! It will involve switching all deprecated constructs to the standard. Some more info here: https://jira.aswf.io/browse/OVDB-139

@Idclip
Copy link
Contributor

Idclip commented Feb 1, 2021

linking #932

@BenFrantzDale
Copy link
Contributor

BenFrantzDale commented Feb 4, 2021

Looks like tbb/mutex.h is also going away. It’s used in Metadata.cc and five others. and can easily be replaced by std::mutex I think. The pattern in five of the six is

#include <tbb/mutex.h>
...
using Mutex = tbb::mutex;
using Lock = Mutex::scoped_lock;

which I think can just become

#include <mutex>
...
using Mutex = std::mutex;
using Lock = std::lock_guard<Mutex>;

Should I make another issue for that or keep it as part of this? (See https://github.com/oneapi-src/oneTBB/tree/v2021.1.1/include/tbb which contains special mutexes like spin_mutex but no longer has mutex.h.)

@Idclip
Copy link
Contributor

Idclip commented Feb 4, 2021

@BenFrantzDale it can be kept as part of this - I've pinned #932 which will essentially solve all these issues (as intel removed support for all deprecated constructs in TBB 2021)

@BenFrantzDale
Copy link
Contributor

@Idclip Do you have a sense how involved it is to do the atomics? It looks like they only show up in a handful of places. I'm itching to upgrade my tbb version and may be motivated to make these changes...

@Idclip
Copy link
Contributor

Idclip commented Feb 4, 2021

I haven't looked too closely at this yet but this document seems to detail a very trivial replacement of most types. The only thing I saw to be different was that the memory semantics for tbb atomics were worded slightly differently to the standard (https://en.cppreference.com/w/cpp/atomic/memory_order). We don't use them in too many places as you pointed out, but we need to make sure they behave identically.

@BenFrantzDale
Copy link
Contributor

^ This looks plausible 22ae4e5

@BenFrantzDale
Copy link
Contributor

Is this now fixed?

@danrbailey
Copy link
Contributor

@BenFrantzDale - not until this PR is merged (#1006). That's your PR with a few minor changes layered on top.

@danrbailey
Copy link
Contributor

I have just merged this PR into the master branch. We'll be doing an 8.1 release soon which will include this change.

Closing out this issue.

@Iktomist
Copy link

Despite the fact that this issue is closed, and has been for over two years, I'm still having problems compiling Blender 3.6.1 because of the TBB references in openVDB. That's from the most recently updated version, too.

@BenFrantzDale
Copy link
Contributor

Despite the fact that this issue is closed, and has been for over two years, I'm still having problems compiling Blender 3.6.1 because of the TBB references in openVDB. That's from the most recently updated version, too.

OpenVDB still depends on TBB, just not the old stuff. I don’t know the exact maximum allowed TBB version for OpenVDB, but I’d guess you just need a recent TBB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants