Skip to content

Commit

Permalink
Add cuda-python as explicit dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Jan 12, 2022
1 parent 2454435 commit 206535d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions conda/environments/cudf_dev_cuda11.5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
- ipython
- pandoc=<2.0.0
- cudatoolkit=11.5
- cuda-python >=11.5,<12.0
- pip
- flake8=3.8.3
- black=19.10
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ requirements:
- packaging
- cachetools
- ptxcompiler # [linux64] # CUDA enhanced compatibility. See https://github.com/rapidsai/ptxcompiler

- cuda-python >=11.5,<12.0
test: # [linux64]
requires: # [linux64]
- cudatoolkit {{ cuda_version }}.* # [linux64]
Expand Down
10 changes: 7 additions & 3 deletions python/cudf/cudf/utils/gpu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def validate_setup():

import warnings

from cuda.cudart import cudaError_t
from cuda.cudart import cudaDeviceAttr, cudaError_t

from rmm._cuda.gpu import (
CUDARuntimeError,
Expand Down Expand Up @@ -68,7 +68,9 @@ def _try_get_old_or_new_symbols():
# Cupy throws RunTimeException to get GPU count,
# hence obtaining GPU count by in-house cpp api above

major_version = getDeviceAttribute("ComputeCapabilityMajor", 0)
major_version = getDeviceAttribute(
cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, 0
)

if major_version >= 6:
# You have a GPU with NVIDIA Pascal™ architecture or better
Expand All @@ -82,7 +84,9 @@ def _try_get_old_or_new_symbols():
pass
else:
device_name = deviceGetName(0)
minor_version = getDeviceAttribute("ComputeCapabilityMinor", 0)
minor_version = getDeviceAttribute(
cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor, 0
)
warnings.warn(
f"You will need a GPU with NVIDIA Pascal™ or "
f"newer architecture"
Expand Down

0 comments on commit 206535d

Please sign in to comment.