如何在配备 Nvidia GeForce GTX 1080 的 Ubuntu 16.04 上安装 CUDA 8.0

如何在配备 Nvidia GeForce GTX 1080 的 Ubuntu 16.04 上安装 CUDA 8.0

我正在尝试在 Ubuntu 16.04 中为 Nvidia GeForce GTX 1080 安装 CUDA 8.0。我安装了 CUDA 7.5,但它似乎与 GTX 1080 不兼容。我从 Nvidia 的开发者页面下载了 .run 安装程序,但安装失败,并将以下内容输出到 nvidia-installer.log

   An NVIDIA kernel module 'nvidia-drm' appears to already be loaded in

   your kernel.  This may be because it is in use (for example, by an X

   server, a CUDA program, or the NVIDIA Persistence Daemon), but this

   may also happen if your kernel was configured without support for

   module unloading.  Please be sure to exit any programs that may be

   using the GPU(s) before attempting to upgrade your driver.  If no

   GPU-based programs are running, you know that your kernel supports

   module unloading, and you still receive this message, then an error

   may have occured that has corrupted an NVIDIA kernel module's usage

   count, for which the simplest remedy is to reboot your computer.

我已重启计算机,但问题仍未解决。如何卸载“nvidia-drm”模块以便安装 8.0 CUDA?

答案1

从阅读您的日志来看,您似乎正在尝试在启动 X 运行时安装 Cuda 驱动程序,从而使用您的 gpu。

您需要先阻止它使用您的 GPU:

  • 删除当前驱动程序:sudo apt-get purge nvidia-cuda*

  • (选修的)- 如果您也想安装驱动程序,请运行:sudo apt-get purge nvidia-*

  • 从 GUI 注销(您未注销是您收到错误消息的原因)。要注销,请按ctrl+ alt+ F2

  • 停止 lightdm:sudo service lightdm stop

  • 现在您可以继续安装驱动程序,在您的情况下,您将必须运行以下命令:sudo sh cuda_8.0.18_linux.run (替换cuda_8.0.18_linux.run为您的 .run 文件的名称)

  • 注意:您需要确保选择/同意创建符号链接的选项。

  • 安装完成后,重新启动机器:sudo reboot

答案2

我遇到了类似的问题。原来有一个韓國正在运行的进程图形处理器我发现这是使用nvidia-smi。终止此进程后,一切安装正常。

答案3

要查看谁在使用 nvidia: sudo lsof | grep nvidia
请停止使用 nvidia 的服务或进程

相关内容