Mutex.h:29: void OpenColorIO_v2_0::DebugLock::lock(): Assertion !m_locked' failed

Hello
Help solve the problem on blender-2.93 and blender-git with OpenColorIO
I make your own build on Genoto
The building is completed successfully, no errors.
When rendering on Cycles Blender crashes with a error (there is pronlem on EEVEE too in other files) (Builds from builder.blender.org works stable, without crashes)

Read blend: /home/bm/Share/RyzenGraphic_27.blend
blender: /var/tmp/portage/media-libs/opencolorio-2.0.1/work/OpenColorIO-2.0.1/src/OpenColorIO/Mutex.h:29: void OpenColorIO_v2_0::DebugLock::lock(): Assertion `!m_locked' failed.
Aborted (core dumped)

CMakeCache.txt (111.6 KB)
https://pasteall.org/blend/db205eee5014426e9df4e5ea8541d3ea
I would be grateful to any advice
(If i need post something more info - please write to me)

Do the builds from https://builder.blender.org work for you? We ship a slightly older OCIO (2.0.0) if the buildbot builds work, it could be that…

Yes, i test buildbot - works great!
But my own builds crashes with ocio-2.0.0 and 2.0.1 too

May be my problem is same as


?
And problem is in blender’s cmake file of ocio?

Unknown, someone will have to sit down and debug it, at this point i suggest you try building with our official build instructions using our SVN libs.

1 Like

Good!
Hope this wil easy for you)

some screencast for showing a crash
https://github.com/brothermechanic/cg/files/6504377/desktop.zip

The issue is this:

So you need to declare NDEBUG (like the blender builds) to work around this issue in the library.
append-flags -DNDEBUG

2 Likes

THANK YOU!!!

NP ^^

You can also look at other changes that I have done to the ebuilds here:

Sadly Optix and NanoVDB is still missing from my changes as I don’t have an Nvidia card to ensure that they work properly.

Wow!
Nice to meet Gentoo user here!
Are you are maintainer of official blender ebuild?
I began to develop my version of blender ebuild because official gentoo version was very lagged behind the mainstream, especially during the transition times 2.4 - 2.5,
now official ebilds are inferior in the rendering speed on the CUDA (2.7),
there are also important new libraries (OpenVDB has been added hard recently), well, of course NanoVDB and Optix)
I work in a blender professionally, my computers have support for the Optix. I propose my help in any related tests, pleasse write to me)
I also invite you to become a developer of my cg overlay, I am sure that you will bring a lot of useful things for the Gentoo community of the blender artists!)

I’ve contributed a fix for this now:

By the way, I think that adding NDEBUG flags is the wrong solution. You should be setting CMAKE_BUILD_TYPE to Release configuration which in turn should define NDEBUG. Otherwise you may be missing out on other optimizations or important flags.

1 Like

Thanks for creating a proper fix!

About the build types:

On Gentoo you define the compiler flags you want to build your packages with yourself.
So if you want to build your whole system and all its programs with link time optimization (-flto), or any other fancy optimization flags, you can do that.
So to make sure that those are respected and extra unwanted flags are not added, the ebuild scripts often create a custom build type for the project.

However for certain projects (like Blender for example), they hard code certain functionality to certain build types. In those cases we could just say “■■■■ it” and force Release or Debug in the build scripts.
But in most cases these can be worked around by finding out what special flags are set in which mode and define them ourselves depending on if the user is building the package with the debug use flag or not.

Right, I’m also not happy with the blender builds in the main tree lagging behind.
That is why I have spent quite a bit of my free time trying to work with Gentoo upstream and getting the ebuilds up to date and feature complete.

From my side of things I would like help with testing out the CUDA and Optix functionality.
In my updated ebuilds you can now run the automated test suite.

So if you could try getting a NanoVDB and Optix ebuild going and checking if the automated tests pass when building with these, that would be awesome.

BTW @brecht I think I remember that I saw that Nvidia gave some specific Optix package to linux distributions (so users didn’t have to go and create an nvidia account to get the dev libraries).
Do you know anything about this or am I perhaps misremembering?

See