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

Handle ucp import error during initialize() #729

Merged
merged 1 commit into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dask_cuda/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ def _create_cuda_context():
try:
# Added here to ensure the parent `LocalCUDACluster` process creates the CUDA
# context directly from the UCX module, thus avoiding a similar warning there.
distributed.comm.ucx.init_once()
try:
distributed.comm.ucx.init_once()
except ModuleNotFoundError:
# UCX intialization has to be delegated to Distributed, it will take care
# of setting correct environment variables and importing `ucp` after that.
# Therefore if ``import ucp`` fails we can just continue here.
pass

cuda_visible_device = int(
os.environ.get("CUDA_VISIBLE_DEVICES", "0").split(",")[0]
Expand Down