Skip to content

Commit 9871a3f

Browse files
authored
Upgrade to use CUDA 13 (#586)
* Upgrade use CUDA 13 Signed-off-by: M Q <mingmelvinq@nvidia.com> * More update to the CI workflows for CUDA 13 Signed-off-by: M Q <mingmelvinq@nvidia.com> * Addressed AI Agent comments on GenAI code Signed-off-by: M Q <mingmelvinq@nvidia.com> * Nit pick on formatting Signed-off-by: M Q <mingmelvinq@nvidia.com> * Nits in the README Signed-off-by: M Q <mingmelvinq@nvidia.com> --------- Signed-off-by: M Q <mingmelvinq@nvidia.com>
1 parent a35d451 commit 9871a3f

17 files changed

Lines changed: 122 additions & 35 deletions

.github/workflows/pr.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,30 @@ jobs:
2323
pip install virtualenv
2424
virtualenv .venv
2525
source .venv/bin/activate
26-
python3 -m pip install nvidia-cuda-runtime-cu12
26+
python3 -m pip install "nvidia-cuda-runtime==13.*"
27+
CUDA_WHL_LIB_DIR="$(python3 -c 'import nvidia.cu13, os; print(os.path.join(nvidia.cu13.__path__[0], "lib"))')"
28+
export LD_LIBRARY_PATH="${CUDA_WHL_LIB_DIR}:${LD_LIBRARY_PATH}"
29+
echo "CUDA_WHL_LIB_DIR=${CUDA_WHL_LIB_DIR}" >> "${GITHUB_ENV}"
30+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "${GITHUB_ENV}"
2731
./run setup
2832
- name: Check formatting
2933
run: |
3034
source .venv/bin/activate
31-
python3 -m pip install nvidia-cuda-runtime-cu12
35+
python3 -m pip install "nvidia-cuda-runtime==13.*"
3236
python3 -c 'import sys; print(sys.executable)'
3337
python3 -c 'import site; print(site.getsitepackages())'
3438
python3 -m pip freeze
35-
export CUDA_WHL_LIB_DIR=$(python3 -c 'import nvidia.cuda_runtime; print(nvidia.cuda_runtime.__path__[0])')/lib
36-
export LD_LIBRARY_PATH="$CUDA_WHL_LIB_DIR:$LD_LIBRARY_PATH"
3739
python3 -c 'from holoscan.core import *'
3840
./run check -f
3941
- name: Run Unit tests
4042
run: |
4143
source .venv/bin/activate
42-
python3 -m pip install nvidia-cuda-runtime-cu12
43-
export CUDA_WHL_LIB_DIR=$(python3 -c 'import nvidia.cuda_runtime; print(nvidia.cuda_runtime.__path__[0])')/lib
44-
export LD_LIBRARY_PATH="$CUDA_WHL_LIB_DIR:$LD_LIBRARY_PATH"
44+
python3 -m pip install "nvidia-cuda-runtime==13.*"
4545
./run test all unit
4646
- name: Coverage
4747
run: |
4848
source .venv/bin/activate
49-
python3 -m pip install nvidia-cuda-runtime-cu12
50-
export CUDA_WHL_LIB_DIR=$(python3 -c 'import nvidia.cuda_runtime; print(nvidia.cuda_runtime.__path__[0])')/lib
51-
export LD_LIBRARY_PATH="$CUDA_WHL_LIB_DIR:$LD_LIBRARY_PATH"
49+
python3 -m pip install "nvidia-cuda-runtime==13.*"
5250
coverage xml
5351
- name: Upload coverage
5452
uses: codecov/codecov-action@v2

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ pip install monai-deploy-app-sdk
3838

3939
### Prerequisites
4040

41-
- This SDK depends on [NVIDIA Holoscan SDK](https://pypi.org/project/holoscan/) for its core implementation as well as its CLI, hence inherits its prerequisites, e.g. Ubuntu 22.04 with glibc 2.35 on X86-64 and NVIDIA dGPU drivers version 535 or above. Important to note that `holoscan` and `holoscan-cli` up to v4.2 are compatible.
42-
- Key runtime dependencies also include [nvidia-nvimgcodec](https://pypi.org/project/nvidia-nvimgcodec-cu12/) and its own dependencies for GPU accecelerated DICOM image decoding.
43-
- [CUDA 12.2](https://developer.nvidia.com/cuda-12-2-0-download-archive) or above is required along with a supported NVIDIA GPU with at least 8GB of video RAM.
44-
- If inference is not used in an example application and a GPU is not installed, at least [CUDA 12 runtime](https://pypi.org/project/nvidia-cuda-runtime-cu12/) is required, as this is one of the requirements of Holoscan SDK. In addition, the `LIB_LIBRARY_PATH` must be set to include the installed shared library, e.g. in a Python 3.10 env, ```export LD_LIBRARY_PATH=`pwd`/.venv/lib/python3.10/site-packages/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH```
41+
- This SDK depends on [NVIDIA Holoscan SDK (CUDA 13)](https://pypi.org/project/holoscan-cu13/) for its core implementation as well as its CLI, hence inherits its prerequisites, e.g. Ubuntu 22.04 with glibc 2.35+ (see output of ldd --version) and CUDA Runtime 13.0 or above. It is important to note that `holoscan-cu13` and `holoscan-cli` up to version 4.2 are compatible.
42+
- Key runtime dependencies also include [nvidia-nvimgcodec](https://pypi.org/project/nvidia-nvimgcodec-cu13/) and its own dependencies for GPU-accelerated DICOM image decoding.
43+
- [CUDA 13.0](https://developer.nvidia.com/cuda-downloads) or above is required along with a supported NVIDIA GPU with at least 8GB of video RAM.
44+
- If inference is not used in an example application and a GPU is not installed, at least [CUDA 13 runtime](https://pypi.org/project/nvidia-cuda-runtime/) is required, as this is one of the requirements of Holoscan SDK. In addition, the `LD_LIBRARY_PATH` must be set to include the installed shared library, e.g. in a Python 3.10 env, ```export LD_LIBRARY_PATH=`pwd`/.venv/lib/python3.10/site-packages/nvidia/cu13/lib:$LD_LIBRARY_PATH```
4545
- Python: 3.10 to 3.13
4646

4747
## Getting Started

THIRD_PARTY_NOTICES/nvidia-nvimgcodec_Apache2.0_LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nvidia-nvimgcodec (PyPI package: nvidia-nvimgcodec-cu12)
1+
nvidia-nvimgcodec (PyPI package: nvidia-nvimgcodec-cu13)
22

33
The MONAI Deploy App SDK optionally integrates with NVIDIA nvImageCodec for
44
GPU-accelerated DICOM compressed pixel data decoding.

monai/deploy/operators/decoder_nvimgcodec.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _decode_frame(src: bytes, runner: DecodeRunner) -> bytearray | bytes
108108
nvimgcodec = None
109109

110110
# nvimgcodec pypi package name, minimum version required and the label for this decoder plugin.
111-
NVIMGCODEC_MODULE_NAME = "nvidia.nvimgcodec" # from nvidia-nvimgcodec-cu12 or other variants
111+
NVIMGCODEC_MODULE_NAME = "nvidia.nvimgcodec" # from nvidia-nvimgcodec-cu13 or other variants
112112
NVIMGCODEC_MIN_VERSION = "0.6"
113113
NVIMGCODEC_MIN_VERSION_TUPLE = tuple(int(x) for x in NVIMGCODEC_MIN_VERSION.split("."))
114114
NVIMGCODEC_PLUGIN_LABEL = "0.6+nvimgcodec" # to be sorted to first in ascending order of plugins
@@ -139,7 +139,12 @@ def _decode_frame(src: bytes, runner: DecodeRunner) -> bytearray | bytes
139139

140140
# Required for decoder plugin
141141
DECODER_DEPENDENCIES = {
142-
x: ("numpy", "cupy", f"{NVIMGCODEC_MODULE_NAME}>={NVIMGCODEC_MIN_VERSION}, nvidia-nvjpeg2k-cu12>=0.9.1,")
142+
x: (
143+
"numpy",
144+
"cupy",
145+
f"{NVIMGCODEC_MODULE_NAME}>={NVIMGCODEC_MIN_VERSION}",
146+
"nvidia-nvjpeg2k-cu13>=0.9.1",
147+
)
143148
for x in SUPPORTED_TRANSFER_SYNTAXES
144149
}
145150

monai/deploy/operators/dicom_series_to_volume_operator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def __init__(self, fragment: Fragment, *args, affine_lps_to_ras: bool = True, **
6464
based decoder plugins are available at runtime.
6565
6666
Registering the decoder plugin is all automatic and does not require any additional change in user's application
67-
except for adding a dependency on the `nvimgcodec-cu12` and `nvidia-nvjpeg2k-cu12` packages (suffix of cu12 means
68-
CUDA 12.0 though cu13 is also supported).
67+
except for adding a dependency on the `nvidia-nvimgcodec-cu13` and `all` of its optional dependencies.
6968
7069
Named Input:
7170
study_selected_series_list: List of StudySelectedSeries.

notebooks/tutorials/01_simple_app.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@
959959
"source": [
960960
"tag_prefix = \"simple_imaging_app\"\n",
961961
"\n",
962-
"!monai-deploy package simple_imaging_app -c simple_imaging_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 --cuda 12 -l DEBUG"
962+
"!monai-deploy package simple_imaging_app -c simple_imaging_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG"
963963
]
964964
},
965965
{

notebooks/tutorials/02_mednist_app-prebuilt.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"source": [
162162
"tag_prefix = \"mednist_app\"\n",
163163
"\n",
164-
"!monai-deploy package \"source/examples/apps/mednist_classifier_monaideploy/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"source/examples/apps/mednist_classifier_monaideploy/app.yaml\" -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG --cuda 12"
164+
"!monai-deploy package \"source/examples/apps/mednist_classifier_monaideploy/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"source/examples/apps/mednist_classifier_monaideploy/app.yaml\" -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG"
165165
]
166166
},
167167
{

notebooks/tutorials/02_mednist_app.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@
10231023
"source": [
10241024
"tag_prefix = \"mednist_app\"\n",
10251025
"\n",
1026-
"!monai-deploy package \"mednist_app/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"mednist_app/app.yaml\" -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG --cuda 12"
1026+
"!monai-deploy package \"mednist_app/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"mednist_app/app.yaml\" -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG"
10271027
]
10281028
},
10291029
{

notebooks/tutorials/03_segmentation_app.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@
989989
"source": [
990990
"tag_prefix = \"my_app\"\n",
991991
"\n",
992-
"!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG --cuda 12"
992+
"!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG"
993993
]
994994
},
995995
{

notebooks/tutorials/04_monai_bundle_app.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@
740740
"source": [
741741
"tag_prefix = \"my_app\"\n",
742742
"\n",
743-
"!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG --cuda 12 "
743+
"!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG"
744744
]
745745
},
746746
{

0 commit comments

Comments
 (0)