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

[REVIEW] Add GPU and CUDA validations #4692

Merged
merged 31 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5961872
add GPU support, runtime & driver checks
galipremsagar Mar 25, 2020
e92c6b5
Update python/cudf/cudf/__init__.py
galipremsagar Mar 25, 2020
91baa1c
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar Mar 25, 2020
9617fb9
change error message to provide driver versions and url to compatibil…
galipremsagar Mar 25, 2020
0709532
modify error text
galipremsagar Mar 25, 2020
a61ab8e
Update python/cudf/cudf/__init__.py
galipremsagar Mar 25, 2020
d1f1717
add cpp apis and cython/python bridge
galipremsagar Mar 26, 2020
44de100
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar Mar 26, 2020
bc55a75
Update CHANGELOG.md
galipremsagar Mar 26, 2020
2be6ea3
Merge branch 'branch-0.14' into init_check
galipremsagar Mar 26, 2020
8d1482b
Update python/cudf/cudf/utils/gpu_utils.py
galipremsagar Mar 26, 2020
2e05d96
create a new module _cuda to keep all cuda related apis
galipremsagar Mar 27, 2020
e4c3288
remove cpp file
galipremsagar Mar 27, 2020
fe75c23
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar Mar 31, 2020
7272afc
Apply suggestions from code review
galipremsagar Mar 31, 2020
04826a1
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar Mar 31, 2020
0d9c6bb
Merge branch 'branch-0.14' into init_check
galipremsagar Mar 31, 2020
e6add1e
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar Mar 31, 2020
7c8cb5b
remove except + for c apis
galipremsagar Mar 31, 2020
6818152
add param types in docs
galipremsagar Apr 1, 2020
6ac3a93
add getDeviceProperties api
galipremsagar Apr 1, 2020
5171b0e
do inline skip of isort
galipremsagar Apr 1, 2020
7d6dcc8
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar Apr 1, 2020
79854f4
Merge remote-tracking branch 'upstream/branch-0.14' into init_check
galipremsagar Apr 1, 2020
0643e71
add error handling
galipremsagar Apr 1, 2020
3a7ab8c
add docs
galipremsagar Apr 1, 2020
012a6de
print the detected cuda runtime version
galipremsagar Apr 1, 2020
6032e64
Apply suggestions from code review
galipremsagar Apr 2, 2020
b0bb113
fetching only the properties required instead of queries all props of…
galipremsagar Apr 2, 2020
8f8fd5c
Merge branch 'init_check' of https://github.com/galipremsagar/cudf in…
galipremsagar Apr 2, 2020
2e23210
Update python/cudf/cudf/_cuda/gpu.pxd
galipremsagar Apr 2, 2020
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
51 changes: 50 additions & 1 deletion python/cudf/cudf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,58 @@
# Copyright (c) 2018-2019, NVIDIA CORPORATION.
""" __init__.py

isort:skip_file
"""
import cupy

import rmm
from cudf.errors import UnSupportedGPUError, UnSupportedCUDAError

gpus_count = cupy.cuda.runtime.getDeviceCount()


if gpus_count > 0:
for device in range(0, gpus_count):
# cudaDevAttrComputeCapabilityMajor - 75
major_version = cupy.cuda.runtime.deviceGetAttribute(75, device)

if major_version >= 6:
# You have a GPU with NVIDIA Pascal™ architecture or better
pass
else:
raise UnSupportedGPUError(
"You will need a GPU with NVIDIA Pascal™ architecture or better"
)

cuda_runtime_version = cupy.cuda.runtime.runtimeGetVersion()

if cuda_runtime_version > 10000:
# CUDA Runtime Version Check: Runtime version is greater than 10000
pass
else:
raise UnSupportedCUDAError(
"Please update your CUDA Runtime to 10.0 or above"
)

cuda_driver_version = cupy.cuda.runtime.driverGetVersion()

if cuda_driver_version == 0:
raise UnSupportedCUDAError("Please install CUDA Driver")
elif cuda_driver_version >= cuda_runtime_version:
# CUDA Driver Version Check: Driver Runtime version is >= Runtime version
pass
else:
raise UnSupportedCUDAError(
"Please update your CUDA Driver to 10.0 or above"
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
)

else:
import warnings

warnings.warn(
"You donot have an NVIDIA GPU, please install one and try again"
)

import rmm
from cudf import core, datasets
from cudf._version import get_versions
from cudf.core import DataFrame, Index, MultiIndex, Series, from_pandas, merge
Expand Down
9 changes: 9 additions & 0 deletions python/cudf/cudf/errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2020, NVIDIA CORPORATION.


class UnSupportedGPUError(Exception):
pass


class UnSupportedCUDAError(Exception):
pass