From 07c00d153ec2bd12e0fe4372e857ac8b04816af3 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 23 Jul 2024 18:32:57 +0800 Subject: [PATCH] Add doc for installing CUDA 12.4 (#1296) Note that torch 2.4 supports CUDA 12.4 --- docs/source/installation/cuda-cudnn.rst | 77 +++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/docs/source/installation/cuda-cudnn.rst b/docs/source/installation/cuda-cudnn.rst index 5dc78b4d5..01f4139b2 100644 --- a/docs/source/installation/cuda-cudnn.rst +++ b/docs/source/installation/cuda-cudnn.rst @@ -692,3 +692,80 @@ The output should look like the following: Built on Tue_Feb__7_19:32:13_PST_2023 Cuda compilation tools, release 12.1, V12.1.66 Build cuda_12.1.r12.1/compiler.32415258_0 + +CUDA 12.4 +--------- + +You can use the following commands to install CUDA 12.4. We install it +into ``/star-fj/fangjun/software/cuda-12.4.0``. You can replace it +if needed. + +.. code-block:: bash + + wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run + + chmod +x cuda_12.4.0_550.54.14_linux.run + + ./cuda_12.4.0_550.54.14_linux.run \ + --silent \ + --toolkit \ + --installpath=/star-fj/fangjun/software/cuda-12.4.0 \ + --no-opengl-libs \ + --no-drm \ + --no-man-page + +Install cuDNN for CUDA 12.4 +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Now, install ``cuDNN`` for CUDA 12.4. + +.. code-block:: bash + + wget https://huggingface.co/csukuangfj/cudnn/resolve/main/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz + + tar xvf cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz --strip-components=1 -C /star-fj/fangjun/software/cuda-12.4.0 + +Set environment variables for CUDA 12.4 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Note that we have to set the following environment variables after installing +CUDA 11.8. You can save the following code to ``activate-cuda-12.4.sh`` +and use ``source activate-cuda-12.4.sh`` if you want to activate CUDA 12.4. + +.. code-block:: bash + + export CUDA_HOME=/star-fj/fangjun/software/cuda-12.4.0 + export PATH=$CUDA_HOME/bin:$PATH + export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=$CUDA_HOME/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=$CUDA_HOME/extras/CUPTI/lib64:$LD_LIBRARY_PATH + export CUDAToolkit_ROOT_DIR=$CUDA_HOME + export CUDAToolkit_ROOT=$CUDA_HOME + + export CUDA_TOOLKIT_ROOT_DIR=$CUDA_HOME + export CUDA_TOOLKIT_ROOT=$CUDA_HOME + export CUDA_BIN_PATH=$CUDA_HOME + export CUDA_PATH=$CUDA_HOME + export CUDA_INC_PATH=$CUDA_HOME/targets/x86_64-linux + export CFLAGS=-I$CUDA_HOME/targets/x86_64-linux/include:$CFLAGS + export CUDAToolkit_TARGET_DIR=$CUDA_HOME/targets/x86_64-linux + +To check that you have installed CUDA 12.4 successfully, please run: + +.. code-block:: bash + + which nvcc + + nvcc --version + +The output should look like the following: + +.. code-block:: bash + + /star-fj/fangjun/software/cuda-12.4.0/bin/nvcc + + nvcc: NVIDIA (R) Cuda compiler driver + Copyright (c) 2005-2024 NVIDIA Corporation + Built on Tue_Feb_27_16:19:38_PST_2024 + Cuda compilation tools, release 12.4, V12.4.99 + Build cuda_12.4.r12.4/compiler.33961263_0