安装 Spconv

# 测试 Pytorch 版本
python -c "import torch; print(torch.__version__)"

QA

1. 出现 broken 的问题

-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /sbin/nvcc
-- Check for working CUDA compiler: /sbin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler
    "/sbin/nvcc"
  is not able to compile a simple test program

  issue 上有对应的解法,在 Spconv 根目录下的 CMakeLists.txt 文件中下面这一行前加一点设置

if (SPCONV_BuildCUDA)

  加如下的设置:

set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")

2. 出现 Could NOT find CUDNN 问题

  改了上面的问题后,出现了找不到 CUDNN 的问题:

Could NOT find CUDNN (missing: CUDNN_LIBRARY_PATH CUDNN_INCLUDE_PATH) 

  去下载一个 CUDNN 装上即可:

  • cuDNN Runtime Library for Ubuntu16.04 (Deb)
  • cuDNN Developer Library for Ubuntu16.04 (Deb)
  • cuDNN Code Samples and User Guide for Ubuntu16.04 (Deb)

  安装三个包:

sudo dpkg -i libcudnn7_7.4.2.24-1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.4.2.24-1+cuda10.0_amd64.deb 
sudo dpkg -i libcudnn7-doc_7.4.2.24-1+cuda10.0_amd64.deb

  一定要加上 CUDNN 的路径,之前 CUDA 的路径没有版本号!

export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.0/bin:$PATH

  最后刷新 bash:

source ~/.bashrc

  再去安装 Spconv 即可。

References

  1. Xenial (16.04) cannot find package libboost-all-dev
  2. Ubuntu16.04运行second.pytorch和PointPillars(主要记录遇到的问题)