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

[cuda] Clear cuda context after init #5891

Merged
merged 21 commits into from
Sep 5, 2022

Conversation

turbo0628
Copy link
Member

fixes #5502

Briefing:

Currently, Taichi setup a CUDAContext after ti.init. However, this might cause problems with third-party frameworks, including PyTorch and Numba.

This PR pop out the CUDAContext at the end of ti.init, and push the context back when needed.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit b8b2716
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6311df8bbb5a300008fa5ac0
😎 Deploy Preview https://deploy-preview-5891--docsite-preview.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 settings.

@turbo0628 turbo0628 changed the title Automatically clear cuda context after ti.init [cuda] Automatically clear cuda context after ti.init Aug 27, 2022
@turbo0628 turbo0628 changed the title [cuda] Automatically clear cuda context after ti.init [cuda] Clear cuda context after ti.init Aug 27, 2022
@turbo0628 turbo0628 changed the title [cuda] Clear cuda context after ti.init [cuda] Clear cuda context after init Aug 27, 2022
@turbo0628 turbo0628 requested a review from ailzhang September 2, 2022 08:18
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

Nice!! Thanks!

@ailzhang ailzhang merged commit 3458609 into taichi-dev:master Sep 5, 2022
ailzhang pushed a commit to ailzhang/taichi that referenced this pull request Sep 5, 2022
session

Main goal is to get rid of the to-do in comment as it's fixed taichi-dev#5891
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.

Torch 1.12.0 and Taichi cannot use CUDA at the same time.
2 participants