首页 > 解决方案 > 在 Ubuntu 上安装 CUDA + RAPIDS - “没有可用的内核映像”

问题描述

编辑:在下面的评论中解决。

我正在尝试开始使用 CUDA + RAPIDS。为此,我使用 Ubuntu 18.04 和 NVIDIA Tesla K80 在 Google Compute 上启动了一个 VM。以下是我为了安装软件而运行的命令:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install cuda gcc
sudo apt-get -y autoremove

wget https://repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh
bash Anaconda3-2019.07-Linux-x86_64.sh 
source ~/.bashrc

conda update -n base -c defaults conda

conda create --name test3.7 python=3.7
conda activate test3.7

conda install -c rapidsai -c nvidia -c numba -c conda-forge -c anaconda \
    cudf=0.9 cuml=0.9 cugraph=0.9 python=3.7 anaconda::cudatoolkit=10.0

conda install -c anaconda -c conda-forge -c plotly scipy chardet numpy pandas scikit-learn matplotlib plotly chart-studio

sudo shutdown -r now

然后我尝试使用 cudf 而不是 pandas 运行一点 Python,我收到以下错误:

terminate called after throwing an instance of 'thrust::system::system_error'
  what(): parallel_for failed: no kernel image is available for execution on the device
Aborted (core dumped)

我不确定我错过了什么,因为我已经阅读了许多指南,这些指南都说:“你只需要运行这些少数命令,你就可以开始了!” 列出相同的命令。最近,我发现我应该使用 nvcc 从源代码编译 CUDA 驱动程序,但是我在任何地方都找不到显示要使用哪些命令的指南(每个人都指向几百页长的 PDF由 NVIDIA 而不是实际提供有用的命令)。那么,我还需要做什么才能让 CUDA + RAPIDS 在使用 Tesla K80 的 Ubuntu 18.04 系统上运行?

谢谢!

标签: pythoncudagpurapids

解决方案


如果您安装 RAPIDS 的二进制版本(例如通过 pip 或 conda),那么这些软件包目前需要计算能力为 6.0 或更高的 GPU,如此处所示。当然,这在未来可能会改变。

在某种程度上,这与 RAPIDS 代码的编译方式有关(这也可能意味着 RAPIDS 正在使用早期 GPU 中可能不可用的功能),用于这些二进制文件。您可以通过从源代码构建 RAPIDS 来改变这一点,但通常有充分的理由以这种方式编译代码 - 通常意味着它们使用“较旧”GPU 中不可用的“较新”CUDA 功能。

因此,解决此问题的最简单方法可能是从配备 Tesla K80 的机器切换到配备 Tesla P100 或更新 GPU 的机器。


推荐阅读