Skip to content

Commit

Permalink
Remove has_cuda_context, moved to Distributed
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Sep 10, 2021
1 parent 36adef8 commit 79be65c
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions dask_cuda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,6 @@ def get_gpu_count_mig(return_uuids=False):
return len(uuids)


def has_cuda_context():
"""Check whether the current process already has a CUDA context created.
Returns
-------
``False`` if current process has no CUDA context created, otherwise returns the
index of the device for which there's a CUDA context.
"""
pynvml.nvmlInit()
for index in range(get_gpu_count()):
handle = pynvml.nvmlDeviceGetHandleByIndex(index)
running_processes = pynvml.nvmlDeviceGetComputeRunningProcesses_v2(handle)
for proc in running_processes:
if os.getpid() == proc.pid:
return index
return False


def get_cpu_affinity(device_index=None):
"""Get a list containing the CPU indices to which a GPU is directly connected.
Use either the device index or the specified device identifier UUID.
Expand Down

0 comments on commit 79be65c

Please sign in to comment.