Skip to content

Conversation

@PozzettiAndrea
Copy link

When processing high-resolution textures (e.g., 2048x2048) on complex meshes with millions of faces, a single BVH unsigned_distance query can cause GPU watchdog timeout.

This adds a _batched_unsigned_distance() helper that splits queries into 100K-element batches (matching the rasterization chunk size), preventing kernel timeout while maintaining identical results.

Fixes texture baking hangs at "Sampling attributes" step on large meshes.

Related: PozzettiAndrea/ComfyUI-TRELLIS2#19

When processing high-resolution textures (e.g., 2048x2048) on complex
meshes with millions of faces, a single BVH unsigned_distance query
can cause GPU watchdog timeout.

This adds a _batched_unsigned_distance() helper that splits queries
into 100K-element batches (matching the rasterization chunk size),
preventing kernel timeout while maintaining identical results.

Fixes texture baking hangs at "Sampling attributes" step on large meshes.

Related: PozzettiAndrea/ComfyUI-TRELLIS2#19
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

Successfully merging this pull request may close these issues.

1 participant