From bc532846b348236dcc9168eabbc4ff7cb401192a Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Fri, 12 Apr 2024 15:46:05 -0700 Subject: [PATCH] Update readthedocs configuration --- docs/source/conf.py | 7 +++++++ run | 2 ++ 2 files changed, 9 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 18938a78..69a9bff5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,6 +19,13 @@ f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup read_the_docs'", shell=True, ) + # Update LD_LIBRARY_PATH for CUDA runtime + old_ld_library_path = os.environ.get("LD_LIBRARY_PATH", "") + # Note that 'python3.8' is hard-coded here, it should be updated if the Python version changes by + # .readthedocs.yml or other configurations. + os.environ["LD_LIBRARY_PATH"] = ( + f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/lib/python3.8/site-packages/nvidia/cuda_runtime/lib:{old_ld_library_path}" + ) subprocess.call( "/bin/bash -c 'source /home/docs/checkouts/readthedocs.org/user_builds/" f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup_gen_docs'", diff --git a/run b/run index bcfdc8eb..356615a1 100755 --- a/run +++ b/run @@ -306,6 +306,8 @@ install_python_dev_deps() { # Read the Docs site is using specific setuptools version so should not upgrade it. if [ "$config" = "read_the_docs" ]; then run_command ${MONAI_PY_EXE} -m pip install -q -U pip wheel build + # Install cuda runtime dependency + run_command ${MONAI_PY_EXE} -m pip install -q nvidia-cuda-runtime-cu12 else run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build fi