当前位置: 首页 > news >正文

“thrust“ has no member “device“

背景

安装nvidia的MinkowskiEngine库时,报错:“thrust” has no member “device”(其实还有其他错误,这些错误的本质原因是一样的)

# 安装代码
mkdir -p /workspace
cd /workspace
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd /workspace/MinkowskiEngine
TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9" python3 setup.py install --blas=openblas --force_cuda

原因分析

  1. 笔者的环境是CUDA12.1
  2. 错误的原因很简单,cuda版本太新,thrust库的使用发生了变化
  3. 解决方法很简单:在对应文件中加入需要的头文件,比如src/3rdparty/concurrent_unordered_map.cuh中报标题中的错误,则只需要添加:include <thrust/execution_policy.h>即可

解决方案

mkdir -p /workspace
cd /workspace
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd /workspace/MinkowskiEngine
# <thrust/execution_policy.h>头文件是解决编译报错问题:error: namespace "thrust" has no member "device"
# <thrust/unique.h>、<thrust/sort.h>是解决类似的问题
sed -i '31i #include <thrust/execution_policy.h>' ./src/convolution_kernel.cuh
sed -i '39i #include <thrust/unique.h>\n#include <thrust/remove.h>' ./src/coordinate_map_gpu.cu
sed -i '38i #include <thrust/execution_policy.h>\n#include <thrust/reduce.h>\n#include <thrust/sort.h>' ./src/spmm.cu
sed -i '38i #include <thrust/execution_policy.h>' ./src/3rdparty/concurrent_unordered_map.cuh

TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9" python3 setup.py install --blas=openblas --force_cuda

相关文章:

  • 视觉Transformer架构的前沿优化技术与高效部署
  • Linux 驱动总线中的 ACPI 设备匹配机制是怎么回事儿?【最大特点是设备的自动发现和热插拔性能良好】
  • vue 组件开发
  • C++运动控制卡开发实践指南
  • 【pm2运行ts的终极解决方案】使用pm2+ tsx 运行 TypeScript 文件指南
  • 3.25-3 request断言
  • 代码随想录算法训练营第二十天 | 字符串 | 反转字符串、替换空格、翻转字符串里的单词(很多基础方法)和左旋转字符串
  • Windows下docker使用教程
  • 【C++特殊类的设计】
  • 和鲸科技执行总裁殷自强受邀主讲华中附属同济医院大模型应用通识首期课程
  • 美摄科技开启智能汽车车内互动及娱乐解决方案2.0
  • 音乐webpack(通杀webpack-1)
  • 解决在客户端本地无法访问服务器http方式访问麦克风与摄像头的问题
  • Linux如何判断磁盘是否已分区?
  • 基于yolov11的中空圆柱形缺陷检测系统python源码+pytorch模型+评估指标曲线+精美GUI界面
  • (C语言)静态通讯录(正式版)(C语言小项目)
  • HTML5 Geolocation(地理定位)学习笔记
  • 数字化转型1061丨某著名企业新零售云业务中台总体解决方案(文末有下载方式)
  • springboot使用阿里限流框架-sentinel
  • 数据结构之双链表
  • 上海网站建设网站制/推广品牌的方法
  • 黄冈网站建设/百度站长链接提交
  • 电影网页设计素材/南宁百度快速优化
  • 钦州网站建设/搜狗引擎搜索
  • 微信网站建设多少钱/seo案例分析
  • 安徽省建设厅执业资格注册中心网站/网络精准推广