Included USD libraries cause symbol conflict with addons using USD binding #76490
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76490
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: macOS
Graphics card: N/A
Blender Version
Broken: 2.83 beta
Worked: Never
Included USD libraries cause symbol conflict with addons using USD python bindings. That is, if an addon wants to use USD in it (as a python c-extension most likely), there is an error:
Exact steps for others to reproduce the error
So I can see two possible solutions to this.
3, link python bindings of USD against blender.exe (Not sure how/if this would work)
Willing to work on the solution, but wanted input from Blender developers.
Added subscriber: @BrianSavery
Added subscriber: @dr.sybren
Changed status from 'Needs Triage' to: 'Archived'
Hi Brian!
For future reference, unless a version is an official release, please include the Git hash in reports. The easiest to get this from Blender itself is to click Help → Report a Bug.
For this the USD library needs to support Python 3.7 first. It's still only compatible with Python 2.7. I don't think Blender should switch to a third party version of the library either.
This is done in Blender as well (see
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
in usd.cmake), so the USD library should not conflict. If this namespace is not used in certain parts of the USD library, that would defeat the purpose of that option. This would be a bug in USD, though, and not in Blender.Changed status from 'Archived' to: 'Resolved'
@dr.sybren
You're mistaken about the python3 compatibility:
https://github.com/PixarAnimationStudios/USD/blob/master/CHANGELOG.md#build
USD 20.05 supports Python 3:
"Added support for Python 3. This may be enabled by specifying PXR_USE_PYTHON_3=TRUE when running cmake or by running build_usd.py with Python 3."
The nvidia ones have 3.6 support but you can build master with 3.7: https://developer.nvidia.com/usd-20.02-binary-windows-vs2017-python-3.6
Regardless, if I was using a USD builds with python 2 bindings I would not have gotten to this point.
Furthermore. After filing this I am able to work around this by building blender from source without USD support (which obviously removes the symbol conflict), but I would claim that's not a valid workaround for most users
Changed status from 'Resolved' to: 'Archived'
Not sure about status how that got changed. Sybren marked it in valid, which I think is erroneous.
Might this be related to https://developer.blender.org/T76442 ?
Changed status from 'Archived' to: 'Needs User Info'
I'm very happy to be wrong here :) Still, on Linux they only test with Python 3.6, whereas both the VFX Reference Platform and Blender are on 3.7. That's an infintesemally small difference compared to 2.7 though!
If it is indeed related to #76442, @BrianSavery could you maybe test what happens when you build Blender with the conflicting symbols added to
source/creator/blender.map
? That should hide those symbols; if that is enough I'd be happy to include that in Blender and get things moving forward.Yep will test. Here's what I've done so far:
Added subscriber: @jta
Added subscriber: @ankitm
Changed status from 'Needs User Info' to: 'Confirmed'
(since it's a todo)
Added subscriber: @lvxejay
Added subscriber: @mel
Added subscriber: @YegorSmirnov
Is there any advancement on this issue?
I think that adding a custom namespace is the solution, like specified here:
https://github.com/PixarAnimationStudios/USD/blob/release/BUILDING.md#usd-developer-options
This is also an issue for projects like https://github.com/GPUOpen-LibrariesAndSDKs/BlenderUSDHydraAddon
But apparently only on macOS?
Added subscriber: @JasonSchleifer
Blender already builds USD with a custom namespace: https://developer.blender.org/diffusion/B/browse/master/build_files/build_environment/cmake/usd.cmake$36
I'm certainly open to suggestions on how to solve this issue.
Added subscriber: @karlhendrikse
Using a custom namespace doesn't fix this because the problem isn't a symbol collision.
The problem is that when any shared library is loaded into the process, the USD library looks in the library's Mach-O headers and pulls out function pointers for all special "constructors" and calls them. The USD library contains a macro one can use to declare such "constructors", and they are stored in "
.pxrctor
" sections in the binary. Some of the constructors declared in the USD library cause the application to abort when run multiple times, which is what happens when there are multiple instances of the library loaded, both searching for ".pxrctor
" sections and calling all "constructors" when libraries are loaded.One solution I found is to change the name used for the sections in one instance of the USD library so the instances aren't trying to run each other's "constructors". Changing all occurrences of
pxrctor
intofooctor
(and likewisepxrdtor
intofoodtor
) in the USD library fixed the problem for me.(I had this problem in a separate application, but I found this page when searching for the solution and after figuring it out for myself I thought posting here might be helpful.)
Unassigning myself, as I'm no longer active in the Pipeline, Assets & IO module.