_driver.cpython-36m-x86_64-linux-gnu.so:未定义符号:_ZN5boost6detail12set_tss_dataEPKvPFvPFvPvES3_ES5_S3_b

问题描述

我尝试运行 Nvidia TensoRT 的 python 示例,但在导入 pycuda 时出错:

ImportError: .../pycuda-2020.1-py3.6-linux-x86_64.egg/pycuda/_driver.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN5boost6detail12set_tss_dataEPKvPFvPFvPvES3_ES5_S3_b

我的环境:

  • Nvidia 驱动程序版本:460.73.01
  • CUDA 版本:10.0
  • CUDNN 版本:7.6.4
  • 操作系统 + 版本:Ubuntu 16.04
  • Python 版本:3.6.13

我是如何安装pycuda的:

  • pip install numpy==1.16
  • sudo apt-get install build-essential python-dev python-setuptools libboost-python-dev libboost-thread-dev -y
  • 安装提升:
    ./bootstrap.sh --with-libraries=python
    ./b2 --with-python include=".../include/python3.6m/"
    sudo ./b2 install
    
  • 安装pycuda: 我首先运行 ./configure.py --cuda-root=/usr/local/cuda-10.0,然后我更改了 siteconf.py 中的设置:USE_SHIPPED_BOOST --> False; BOOST_PYTHON_LIBNAME --> ['boost_python36']。然后
    make
    sudo make install
    

安装 PyCuda 后,我安装了 TensorFlow 1.15 和 TensorRT 7。错误发生在 from pycuda._driver import * # noqa 行上。

请教我如何解决这个问题。谢谢

解决方法

我通过下载 repo 中的文件,将它们放入 pycuda 文件夹解决了这个问题。然后我设置了 USE_SHIPPED_BOOST = True 并将其包装起来。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...