当前位置:   article > 正文

redhat 9.1 RHEL 9.1 安装 cuda 12.0_rhel9 cuda

rhel9 cuda


下载 .run

wget https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run

安装Linux kernel开发环境:

sudo dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

禁用开源驱动,

在文件 /etc/modprobe.d/blacklist-nouveau.conf 中写入如下内容:

  1. blacklist nouveau
  2. options nouveau modeset=0

以重新生成 initramfs
执行命令:
 

sudo dracut --force


然后重启系统:

sudo reboot

lsmod 看不到 nouveau


安装 cuda sdk 12.0:

sudo sh cuda_12.0.1_525.85.12_linux.run


安装后的输出:

  1. [cudaguy@localhost Downloads]$ sudo sh ./cuda_12.0.1_525.85.12_linux.run
  2. [sudo] password for cudaguy:
  3. ===========
  4. = Summary =
  5. ===========
  6. Driver:   Installed
  7. Toolkit:  Installed in /usr/local/cuda-12.0/
  8. Please make sure that
  9.  -   PATH includes /usr/local/cuda-12.0/bin
  10.  -   LD_LIBRARY_PATH includes /usr/local/cuda-12.0/lib64, or, add /usr/local/cuda-12.0/lib64 to /etc/ld.so.conf and run ldconfig as root
  11. To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.0/bin
  12. To uninstall the NVIDIA Driver, run nvidia-uninstall
  13. Logfile is /var/log/cuda-installer.log
  14. [cudaguy@localhost Downloads]$

 

重启系统:

sudo reboot

设置cuda 环境变量:

  1. export PATH=/usr/local/cuda-12.0/bin:$PATH
  2. export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64:$LD_LIBRARY_PATH

下载示例:

git clone https://github.com/NVIDIA/cuda-samples.git

编译示例:

安装cudnn

下载

解压

拷贝

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/128546
推荐阅读
相关标签
  

闽ICP备14008679号