Skip to content

Commit

Permalink
Add GPU executor if GPU is present
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Jul 26, 2021
1 parent 145e8aa commit b4a2363
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,15 @@ def __init__(
"offload": utils._offload_executor,
"actor": ThreadPoolExecutor(1, thread_name_prefix="Dask-Actor-Threads"),
}
try:
import pynvml
except ImportError:
pass
else:
if pynvml.nvmlDeviceGetCount():
self.executors["gpu"] = ThreadPoolExecutor(
1, thread_name_prefix="Dask-GPU-Threads"
)

# Find the default executor
if executor == "offload":
Expand Down

0 comments on commit b4a2363

Please sign in to comment.