我有一个 PyTorch 模型的 docker 图像,当在 debian/Tesla P4 GPU/google 深度学习图像上运行的 google 计算引擎 VM 中运行时返回此错误:
CUDA kernel failed : no kernel image is available for execution on the device
这发生在调用我的模型的行上。PyTorch 模型包括自定义 c++ 扩展,我正在使用这个模型https://github.com/daveredrum/Pointnet2.ScanNet
我的图像在运行时安装这些
该图像在我的本地系统上运行良好。VM 和我的系统都有以下版本:
cuda编译工具10.1、V10.1.243
火炬 1.4.0
火炬视觉 0.5.0
据我所知,主要区别在于GPU
当地的:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 960M Off | 00000000:01:00.0 Off | N/A |
| N/A 36C P8 N/A / N/A | 361MiB / 2004MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
虚拟机:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.01 Driver Version: 418.87.01 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P4 Off | 00000000:00:04.0 Off | 0 |
| N/A 42C P0 23W / 75W | 0MiB / 7611MiB | 3% Default |
如果我 ssh 进入虚拟机torch.cuda.is_available()
返回true
因此我怀疑它一定与扩展的编译有关
这是我的 docker 文件的相关部分:
ENV CUDA_HOME "/usr/local/cuda-10.1"
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda-10.1/bin:${PATH}
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=418,driver<419"
ENV FORCE_CUDA=1
# CUDA 10.1-specific steps
RUN conda install -c open3d-admin open3d
RUN conda install -y -c pytorch \
cudatoolkit=10.1 \
"pytorch=1.4.0=py3.6_cuda10.1.243_cudnn7.6.3_0" \
"torchvision=0.5.0=py36_cu101" \
&& conda clean -ya
RUN pip install -r requirements.txt
RUN pip install flask
RUN pip install plyfile
RUN pip install scipy
# Install OpenCV3 Python bindings
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \
libgtk2.0-0 \
libcanberra-gtk-module \
libgl1-mesa-glx \
&& sudo rm -rf /var/lib/apt/lists/*
RUN dir
RUN cd pointnet2 && python setup.py install
RUN cd ..
我已经在虚拟机中从 ssh 重新运行了这一行:
TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0" python setup.py install
我认为哪个是针对 Tesla P4 计算能力的安装?
我可以尝试其他一些设置或故障排除步骤吗?
直到几天前,我才对 docker/VMs/pytorch 扩展一无所知,所以有点在黑暗中拍摄。这也是我的第一篇 stackoverflow 帖子,如果我没有遵守一些礼仪,请随时指出。