-
Notifications
You must be signed in to change notification settings - Fork 17
Avoid using numba to set device context in import #145
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
Changes from 1 commit
67f2df1
d6fb5a9
18c42f3
e9e750b
9efdbf9
6843832
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,22 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| HAS_GPU = False | ||
| try: | ||
| from numba import cuda | ||
|
|
||
| try: | ||
| HAS_GPU = len(cuda.gpus.lst) > 0 | ||
| except cuda.cudadrv.error.CudaSupportError: | ||
| pass | ||
| except ImportError: | ||
| cuda = None | ||
|
|
||
| HAS_GPU = False | ||
| try: | ||
| import dask_cuda | ||
|
|
||
| HAS_GPU = dask_cuda.utils.get_gpu_count() | ||
oliverholworthy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| except ImportError: | ||
| # Don't let numba.cuda set the context | ||
| # unless dask_cuda is not installed | ||
| if cuda is not None: | ||
| try: | ||
| HAS_GPU = len(cuda.gpus.lst) > 0 | ||
|
||
| except cuda.cudadrv.error.CudaSupportError: | ||
| pass | ||
Uh oh!
There was an error while loading. Please reload this page.