尝试在Ubuntu 18.04上安装CUDA 9.2

时间:2018-08-10 15:10:30

标签: cuda driver nvidia ubuntu-18.04

我正在尝试在this网站之后的Ubuntu 18.04上安装CUDA 9.2:

我已经下载了NVIDIA CUDA Toolkit(shell脚本cuda_9.2.88_396.26_linux),但是当我运行它($ sudo sh cuda_9.2.88_396.26_linux)时,这就是我得到的:

Installing the NVIDIA display driver...
A system reboot is required to continue installation. Please reboot then run the installer again. 
An attmept has been made to disable Nouveau. 
If this message persists after reboot, please see the display driver log file at /var/log/nvidia-installer.log for more information.

因此,我重新启动,然后再次运行shell脚本($ sudo sh cuda_9.2.88_396.26_linux),并且得到了相同的消息。这就是nvidia-installer.log所说的:

 ERROR: The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /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 reenable Nouveau, you will need to delete these files: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
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.

我已经安装了我的nvidia驱动程序。

1 个答案:

答案 0 :(得分:1)

首先,我将遵循the official guide,包括安装前的说明。通读每一行,如果从一开始就很周到,就可以节省时间。

“懒人两次工作”

第二:这是在遵循Runfile安装的情况下在Ubuntu中禁用Nouveau的说明。

  1. 检查是否已加载Nouveau驱动程序。如果以下命令显示任何内容,则将加载Nouveau驱动程序

    $ lsmod | grep nouveau  
    
  2. 在/etc/modprobe.d/blacklist-nouveau.conf中创建一个文件,其内容如下:

    blacklist nouveau
    options nouveau modeset=0
    
  3. 重新生成内核initramfs:

    $ sudo update-initramfs -u
    

完成后,请确保一路完成安装后的操作。

最后:请确保您要安装的CUDA版本列出了所使用的Ubuntu版本!!!! 最好的版本是所有版本,但是最新版本的CUDA不一定可以在最新版本的Ubuntu上运行。一些更高级的用户可以使它正常工作,但是我不能在那里指导您。检查CUDA工具包和cuDNN的受支持版本(如果正在使用)。

祝你好运。安装cuda可能会有些麻烦,这是避免略过任何安装步骤所必需的。 youtube上还有一些有用的视频,如果您遇到麻烦,可能会有用。