这个是 nvcc 编译 ptx isa 指令时的版本兼容性问题,当前版本只支持 PTX ISA 6.4,但是 cu 源代码用的是 7.8 版本的指令集。nvcc 属于 CUDA Toolkit 工具包。
有两个原因:一是 cuda 版本太低,二是多个 cuda 版本共存时, nvcc 错误的使用了低版本编译器导致。
https://docs.nvidia.com/cuda/parallel-thread-execution/#ptx-isa-version-7-8
问题一
使用 Matching CUDA and NVPTX ISA Versions 页面的手册来升级到相应版本 CUDA。对照错误消息中的 current version is ‘6.4’ 可知 nvcc 错误的使用了 10.1 版本的 cuda。
问题二
有很多办法可以确认是否有多版本 cuda。
- 方法一:Check if CUDA is installed and it’s location with NVCC,find /usr -name “nvcc” ,然后执行 nvcc -V 判断版本。
- 方法二:查找 lib 库中是否有多个版本不同的 .so,find /usr -name “libcudart”
在我的环境中,方法一和方法二都找到了 10.1 版本的 cuda 相关文件,如:
- /lib/x86_64-linux-gnu/libcudart.so.10.1
- /usr/lib/x86_64-linux-gnu/libcudart.so.10.1
- (…)
解决办法
然后使用 sudo apt-get remove nvidia-cuda-toolkit 命令,观察待卸载的软件是否为低版本 cuda 相关,然后继续卸载。
(mmdeploy-1.3.1) chenghj11@wlw-chenaj:/lib/x86_64-linux-gnu$ sudo apt-get remove nvidia-cuda-toolkit
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
g++-8 libaccinj64-10.1 libcublas10 libcublaslt10 libcudart10.1 libcufft10 libcufftw10 libcuinj64-10.1 libcupti-dev libcupti-doc libcupti10.1 libcurand10 libcusolver10
libcusolvermg10 libcusparse10 libegl-dev libegl-mesa0 libegl1 libgail-common libgail18 libgbm1 libgl-dev libgl1-mesa-dev libgles-dev libgles1 libgles2 libglvnd-dev libglx-dev
libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libncurses5 libnppc10 libnppial10 libnppicc10 libnppicom10 libnppidei10 libnppif10 libnppig10 libnppim10 libnppist10 libnppisu10
libnppitc10 libnpps10 libnvblas10 libnvgraph10 libnvidia-ml-dev libnvjpeg10 libnvrtc10.1 libnvtoolsext1 libnvvm3 libopengl-dev libopengl0 libpthread-stubs0-dev libstdc++-8-dev
libthrust-dev libvdpau-dev libwayland-server0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev node-html5shiv nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb nvidia-opencl-dev
nvidia-profiler nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers openjdk-8-jre x11proto-core-dev x11proto-dev xorg-sgml-doctools xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
nvidia-cuda-toolkit
0 upgraded, 0 newly installed, 1 to remove and 338 not upgraded.
After this operation, 67.1 MB disk space will be freed.
Do you want to continue? [Y/n]