Rate This Document
Findability
Accuracy
Completeness
Readability

CUDA Deployment

  1. Use PuTTY to log in to the server as the root user.
  2. Check whether the nouveau driver is disabled.
    lsmod |grep nouveau
    • If the command output is not empty, indicating that the nouveau driver is enabled, perform steps 3 to 6 to disable the nouveau driver.
    • If the command output is empty, indicating that the nouveau driver is disabled, perform subsequent operations from step 7.
  3. Disable the nouveau driver.
    1. Create a /etc/modprobe.d/disable-nouveau.conf file.
      vim /etc/modprobe.d/disable-nouveau.conf
    2. Add the following two lines:
      blacklist nouveau 
      options nouveau modeset=0
  4. Back up the initramfs file and generate a new one.
    cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img 
    dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
  5. Reboot the server.
    reboot
  6. Check that the nouveau driver is disabled.
    lsmod |grep nouveau

    If the command output is empty, the driver is disabled.

  7. Install NVIDIA CUDA.
    wget https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux_sbsa.run 
    sudo sh cuda_11.4.0_470.42.01_linux_sbsa.run
  8. Configure environment variables.
    export CUDA_HOME=/usr/local/cuda 
    export PATH=$CUDA_HOME/bin:$PATH 
    export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
  9. Check whether the installation is successful.
    nvcc -v

    If the version information is displayed, the installation is successful.