Skip to content

Commit

Permalink
Use cupy instead of cuda-python.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Sep 6, 2024
1 parent 8075ba3 commit a509f2d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- c-compiler
- click
- cmake>=3.26.4,!=3.30.0
- cuda-python>=11.7.1,<12.0a0
- cuda-version=11.8
- cudatoolkit
- cupy>=12.0.0
Expand Down
1 change: 0 additions & 1 deletion conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- cmake>=3.26.4,!=3.30.0
- cuda-cudart-dev
- cuda-nvcc
- cuda-python>=12.0,<13.0a0
- cuda-version=12.5
- cupy>=12.0.0
- cxx-compiler
Expand Down
10 changes: 0 additions & 10 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,3 @@ dependencies:
packages:
# Already added to requirements via docs. This is for tests.
- numpydoc>=1.5
specific:
- output_types: [conda, requirements, pyproject]
matrices:
- matrix: {cuda: "12.*"}
packages:
- cuda-python>=12.0,<13.0a0
- matrix: {cuda: "11.*"}
packages: &test_cuda_python_cu11
- cuda-python>=11.7.1,<12.0a0
- {matrix: null, packages: *test_cuda_python_cu11}
1 change: 0 additions & 1 deletion python/cucim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Tracker = "https://github.com/rapidsai/cucim/issues"

[project.optional-dependencies]
test = [
"cuda-python>=11.7.1,<12.0a0",
"imagecodecs>=2021.6.8; platform_machine=='x86_64'",
"matplotlib",
"numpydoc>=1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#

import cuda.cudart
import cupy as cp
import pytest

from ...util.io import open_image_cucim
Expand All @@ -25,14 +25,13 @@
def test_read_region_cuda_memleak(testimg_tiff_stripe_4096x4096_256_jpeg):
def get_used_gpu_memory_mib():
"""Get the used GPU memory in MiB."""
status, free, total = cuda.cudart.cudaMemGetInfo()
if status != cuda.cudart.cudaError_t.cudaSuccess:
raise RuntimeError("Failed to get GPU memory info.")
dev = cp.cuda.Device()
free, total = dev.mem_info
memory_used = (total - free) / (2**20)
return memory_used

status, num_gpus = cuda.cudart.cudaGetDeviceCount()
if status != cuda.cudart.cudaError_t.cudaSuccess or num_gpus == 0:
num_gpus = cp.cuda.runtime.getDeviceCount()
if num_gpus == 0:
pytest.skip("No gpu available")

img = open_image_cucim(testimg_tiff_stripe_4096x4096_256_jpeg)
Expand Down

0 comments on commit a509f2d

Please sign in to comment.