시도 1

시도 1

지금까지 Ubuntu 22.04에 여러 가지 방법으로 NVIDIA 드라이버를 설치하려고 시도했지만 지금까지 아무 것도 작동하지 않았으며 다른 곳에서 솔루션을 찾을 수 있는지 모르겠습니다.

시도 1

먼저 모든 NVIDIA 및 CUDA를 제거했습니다.

sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'

그런 다음 나는 선생님의 지시를 따랐습니다.엔비디아 웹사이트:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-0-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

시도 2

실행 파일을 다운로드했습니다.

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

sudo init 3

CTRL + ALT + F2를 눌러 GUI를 종료하십시오.

달리다sudo sh cuda_12.0.1_525.85.12_linux.run

시도 3

중고 소프트웨어 및 업데이트 도구: 여기에 이미지 설명을 입력하세요

최근 시도에서 다음 로그가 생성되었습니다.

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Sat Feb 25 08:18:52 2023
installer version: 525.85.12

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

nvidia-installer command line:
    ./nvidia-installer
    --ui=none
    --no-questions
    --accept-license
    --disable-nouveau
    --no-cc-version-check
    --install-libglvnd

Using built-in stream user interface
-> Detected 8 CPUs online; setting concurrency level to 8.
-> Installing NVIDIA driver version 525.85.12.
-> An alternate method of installing the NVIDIA driver was detected. (This is usually a package provided by your distributor.) A driver installed via that method may integrate better with your system than a driver installed by nvidia-installer.

Please review the message provided by the maintainer of this alternate installation method and decide how to proceed:

The NVIDIA driver provided by Ubuntu can be installed by launching the "Software & Updates" application, and by selecting the NVIDIA driver from the "Additional Drivers" tab.


(Answer: Continue installation)
WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf, /etc/modprobe.d/nvidia-installer-disable-nouveau.conf.  Please be sure you have rebooted your system since these files were written.  If you have rebooted, then Nouveau may be enabled for other reasons, such as being included in the system initial ramdisk or in your X configuration file.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
-> For some distributions, Nouveau can be disabled by adding a file in the modprobe configuration directory.  Would you like nvidia-installer to attempt to create this modprobe file for you? (Answer: Yes)
-> One or more modprobe configuration files to disable Nouveau have been written.  For some distributions, this may be sufficient to disable Nouveau; other distributions may require modification of the initial ramdisk.  Please reboot your system and attempt NVIDIA driver installation again.  Note if you later wish to re-enable Nouveau, you will need to delete these files: /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf, /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
-> Performing CC sanity check with CC="/usr/bin/cc".
-> Performing CC check.
ERROR: 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.

로그에 따르면 커널에 문제가 있는 것 같습니다. 나는 달리려고 노력했다.

sudo apt-get install linux-headers-`uname -r`

나는 다음을 얻습니다 :

패키지 목록을 읽는 중... 완료

Building dependency tree... Done
Reading state information... Done
Package linux-headers-5.18.10-051810-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Ubuntu 22.04에 드라이버를 설치하는 방법에 대한 제안을 보내주시면 감사하겠습니다.

답변1

핵심은 다음 명령을 사용하여 Linux 헤더를 설치할 수 있다는 것입니다.

sudo apt-get install linux-headers-`uname -r`

커널용 헤더를 설치할 수 없으므로 다음 로그가 생성되었습니다.

Reading package lists... Done

Building dependency tree... Done
Reading state information... Done
Package linux-headers-5.18.10-051810-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

따라서 커널을 5.15.0-60으로 변경하고 sudo apt-get install linux-headers-uname -r을 다시 실행한 후 다음을 사용하여 드라이버 설치를 다시 시도했습니다.시도 3. 커널을 변경한 후에는 위에 나열된 다른 시도도 작동할 것이라고 생각합니다.

여기기본 커널을 설정하는 방법에 대한 설명이 포함된 링크입니다.

관련 정보