Importing Alembic fails after more than ~510 individual cache files #105081

Open
opened 2023-02-22 17:34:06 +01:00 by Stefan Kreller · 1 comment

System Information
Operating system: Windows 10
Graphics card: RTX 2080

Blender Version
Broken: 3.4.1, 3.5.0
Worked: -

Short description of error
I am trying to import a lot of alembic character files. After ~510 successful caches following imports fail with error Could not open Alembic archive for reading! See console for detail. The console additionally prints Could not open as ogawa file from provided streams Individually all of my alembic files import without problems. The alembics are exported from blender. Importing fails for complex characters, as well as the default cube exported as alembic.

Exact steps for others to reproduce the error
Open the attached blend file and run the script from the text editor. It will start to import the (attached) cube.abc without problems until it gets to roughly the 510th import.
At this point it is not possible to import any more alembic caches.

**System Information** Operating system: Windows 10 Graphics card: RTX 2080 **Blender Version** Broken: 3.4.1, 3.5.0 Worked: - **Short description of error** I am trying to import a lot of alembic character files. After ~510 successful caches following imports fail with error `Could not open Alembic archive for reading! See console for detail.` The console additionally prints `Could not open as ogawa file from provided streams` Individually all of my alembic files import without problems. The alembics are exported from blender. Importing fails for complex characters, as well as the default cube exported as alembic. **Exact steps for others to reproduce the error** Open the attached blend file and run the script from the text editor. It will start to import the (attached) `cube.abc` without problems until it gets to roughly the 510th import. At this point it is not possible to import any more alembic caches.
Stefan Kreller added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-02-22 17:34:07 +01:00

I can confirm on both Windows and Linux although the counts differ. Both are affected by limits enforced by the OS on the number of open files for a given process. Linux is higher at around 1024 or so (ulimit -n), while Windows is 512 by default. The failure here occurs at 509 because stdout, stderr, and stdin count towards the limit and those are always open.

Increasing the limit on Windows is possible with a code change but only up to a maximum of 8192 on modern platforms. Linux is more difficult as it would require admin rights to increase I believe.

Ultimately this is caused because of the interaction between depsgraph and BKE_cachefile_eval. The deps graph requests the cachefile and for Alembic that means opening the file and keeping it open for, effectively, the entire time. The true fix would be to only require opening of the file when absolutely necessary and then closing soon after.

I can confirm on both Windows and Linux although the counts differ. Both are affected by limits enforced by the OS on the number of open files for a given process. Linux is higher at around 1024 or so (`ulimit -n`), while Windows is 512 by default. The failure here occurs at 509 because stdout, stderr, and stdin count towards the limit and those are always open. Increasing the limit on Windows is possible with a code change but only up to a maximum of 8192 on modern platforms. Linux is more difficult as it would require admin rights to increase I believe. Ultimately this is caused because of the interaction between depsgraph and `BKE_cachefile_eval`. The deps graph requests the cachefile and for Alembic that means opening the file and keeping it open for, effectively, the entire time. The true fix would be to only require opening of the file when absolutely necessary and then closing soon after.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105081
No description provided.