CUDA 설치 문제 22.04 lts

CUDA 설치 문제 22.04 lts

방금 우분투 22.04로 업데이트했고, cuda 설치를 업데이트하려고 합니다. 그러나 패키지를 엉망으로 만들었을 수도 있습니다. "문제를 해결할 수 없습니다. 손상된 패키지를 보유하고 있습니다." 이전 설치를 제거하려고 할 때 뭔가 잘못되었을 수 있습니다.

다음을 통해 cuda 및 cuda 툴킷을 설치하려고 합니다.https://developer.nvidia.com/, 그리고 마지막 단계에서 멈춥니다. apt에서 직접 설치하려고 하면 동일한 오류가 발생합니다(아래 참조).

도와주세요. 내가 뭘 잘못했는지 잘 모르겠습니다.

(base) xxx@xxx:~$ sudo apt install cuda
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 cuda-drivers-515 : Depends: nvidia-modprobe (>= 515.65.01) but 470.103.01-1 is to be installed
                    Depends: nvidia-settings (>= 515.65.01) but 510.47.03-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

(base) xxx@xxx:~$ apt-cache policy nvidia-modprobe
nvidia-modprobe:
  Installed: 470.103.01-1
  Candidate: 470.103.01-1
  Version table:
     515.65.01-0ubuntu1 450
        450 file:/var/cuda-repo-ubuntu2204-11-7-local  Packages
 *** 470.103.01-1 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages
        100 /var/lib/dpkg/status

(base) xxx@xxx:~$ apt-cache policy nvidia-settings
nvidia-settings:
  Installed: 510.47.03-0ubuntu1
  Candidate: 510.47.03-0ubuntu1
  Version table:
     515.65.01-0ubuntu1 450
        450 file:/var/cuda-repo-ubuntu2204-11-7-local  Packages
 *** 510.47.03-0ubuntu1 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

(base) xxx@xxx:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

답변1

apt로 문제를 직접 해결할 수는 없었지만 다음 단계를 수행하면 cuda 설치가 해결되었습니다.

  1. 모든 nvidia 및 cuda 드라이버 제거(sudo aptremove --purge nvidia-* && sudo aptremove --purge cuda*)
  2. deb 패키지가 아닌 RUN 로컬 파일을 사용하여 Nvidia 소스를 통해 cuda를 설치합니다. 첫 번째 실행에서 Nvidia 드라이버를 성공적으로 설치했지만 툴킷 설치에 실패했습니다.
  3. 툴킷을 선택하여 RUN 파일을 두 번째로 실행하십시오.

이 단계를 통해 내 문제가 해결되었습니다. 다른 사람에게 도움이 되기를 바랍니다.

관련 정보