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

fix(rendering): Allow memory sizes between 2gb and 4gb by using wasm allocation #1260

Merged
merged 6 commits into from
May 21, 2024

Conversation

wayfarer3130
Copy link
Collaborator

Context

Browsers don't allow allocation of more than 2gb memory using the standard buffer allocators. This PR adds the ability to allocate using the WebAssembly.Memory allocator, which seems to work fine up to 4 gb, although the GPU does complain about memory texture size limits.

Changes & Results

Added a test example, using local data for now (and so not in the shared examples), plus changed the createFloat32SharedArray to use WebAssembly.Memory

Testing

Deploy the test data to localhost:5000/dicomweb
Run
yarn example volumeLarge
View the page, should display (may still be browser dependent).

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

Copy link

netlify bot commented May 21, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit a18ec5a
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/664cb229d9431b0008138082
😎 Deploy Preview https://deploy-preview-1260--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@IbrahimCSAE
Copy link
Collaborator

works great on orthanc but seems there's some issues when using P10 dicom from local

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worked great, see my FYIs that i fixed

packages/core/src/cache/cache.ts Show resolved Hide resolved
packages/core/src/loaders/volumeLoader.ts Show resolved Hide resolved
@sedghi sedghi changed the title fix: Allow memory sizes between 2gb and 4gb by using wasm allocation fix(rendering): Allow memory sizes between 2gb and 4gb by using wasm allocation May 21, 2024
@sedghi sedghi merged commit a00952e into main May 21, 2024
10 checks passed
@sedghi sedghi deleted the fix/largeMemory-wasm branch January 22, 2025 16:05
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.

4 participants