小飞侠 - 2023年8月
type: channel
link: http://www.kexue.love/index.php/2023/08/
description: 爱科学-刘磊
items: centos安装cuda|gpu驱动

centos安装cuda|gpu驱动
type: item
date: 2023-08-23T03:14:00+00:00
description: 一、cuda-driver下载安装1.查看cuda-driver是否安装nvidia-smi来查看驱动是否安装如果没有安装，可通过cuda-toolkit下载，里面包含了驱动一起安装基于cuda-toolkit下载，里面包含了驱动，主要在里面下载对应的版本。https://developer.nvidia.com/cuda-toolkit-archive2.问题问题1.安装驱动报错：/var/log/nvidia-installer.logERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option. ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com. 解决办法：yum install kernel-devel-$(uname -r) sh cuda_12.2.2_535.104.05_linux.run --kernel-source-path=/usr/src/kernels/3.10.0-1160.el7.x86_64/二、cuda-toolkit下载安装包此处的安装环境为离线环境，需要先下载cuda安装文件，安装文件可以去官网地址下载对应的系统版本。官网下载地址：https://developer.nvidia.com/cuda-toolkit-archive驱动和cuda版本对应：https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html查看版本cat /etc/redhat-releaseCentOS Linux release 7.6.1810 (Core)uname -r3.10.0-957.el7.x86_64GPUlspci | grep -i nvidia01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GP102 HDMI Audio Controller (rev a1)驱动版本sudo dpkg --list | grep nvidia-*驱动下载https://www.nvidia.cn/drivers/results/184427/（安装教程）https://blog.csdn.net/dechengtju/article/details/80146248下载与系统内核版本对应的kernel-devel、kernel-headershttp://rpm.pbone.net/问题：Error 'An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel' when trying to get GPU support in AWS EMRhttps://stackoverflow.com/questions/66680948/error-an-nvidia-kernel-module-nvidia-appears-to-already-be-loaded-in-your-kersudo lsof…