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

“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

http://www.kler.cn/a/601480.html

相关文章:

  • OpenEMMA: 基于多模态大语言模型的端到端开源自动驾驶框架
  • linux如何释放内存缓存
  • WPS的PPT智能图形增加项目
  • 解锁PyPDF2:轻松驾驭PDF文件的Python库
  • dell 台式机 电脑 纽扣电池 如何取下?
  • SSE底层实现?SSE 和 websocket的区别?
  • WPF 浅述ToolTipService.ShowOnDisabled
  • 头歌实践教学平台--【数据库概论】--SQL
  • 微信小程序面试内容整理-如何优化小程序的启动速度?
  • HWHVV护网入门基础知识
  • VSCODE右下角切换环境没用
  • 高级java每日一道面试题-2025年3月10日-微服务篇[Eureka篇]-Eureka Server配置配置有哪些?
  • Jboss中间件常见漏洞
  • 4. 如何减少大模型幻觉?⸺大模型外挂向量数据库的分析(知识延伸版)
  • 城电科技|太阳能光伏座椅:点亮智慧城市的绿色便民新体验
  • MySQL 8.0 新特性详解
  • fastapi+angular商品分类和展示
  • Oracle数据库服务器地址变更与监听配置修改完整指南
  • OSI模型_TCP/IP模型_五层模型
  • 屏幕刷新机制(一):机制