gpt4 book ai didi

c++ - CUDA 缺少 host_defines.h centos 7

转载 作者:行者123 更新时间:2023-12-03 12:50:42 27 4
gpt4 key购买 nike

我正在尝试在centos 7.0下的Nsight Eclipse版本6.5环境中编译CUDA工具包V6.5的一些示例。

我的 Nvidia 卡是 Quadro K2000。

所以我的问题是当我尝试构建其中一个示例(在工具包 cuda 6.5 中)时:控制台中出现以下消息,我不知道为什么:

make all 
Building target: ex3
Invoking: NVCC Linker
/usr/bin/nvcc --cudart static -L/usr/include/cuda --relocatable-device-code=false -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=sm_20 -link -o "ex3" ./src/matrixMulCUBLAS.o -lcublas
/usr/bin/crt/link.stub:2:26: erreur fatale: host_defines.h : Aucun fichier ou dossier de ce type
#include "host_defines.h"
^
compilation terminée.
make: *** [ex3] Erreur 1




17:17:30 Build Finished (took 57ms)

有人可以帮我吗?

最佳答案

感谢您的快速评论我发现了问题:有 2 个地方有 NVCC exe

/usr/local/cuda-6.5/bin/nvcc and / usr / bin / nvcc

所以,我做到了:

diff --side-by-side /usr/local/cuda-6.5/bin/nvcc /usr/bin/nvcc

=>文件不同

此外,/usr/local/cuda-6.5/bin/中有一个nvcc.profile文件,用于定位环境变量。并且Nsight eclipse环境使用/usr/bin/nvcc 然后 我在这两个文件上建立了符号链接(symbolic link):

ln -s /usr/local/cuda-6.5/bin/nvcc nvcc
ln -s /usr/local/cuda-6.5/bin/nvcc.profile nvcc.profile

现在任何项目都可以构建和运行

但是解决方案并不完全好(因为符号链接(symbolic link))

现在我不知道如何在 Nsight Eclipse 版本 6.5 中配置我的项目以使用位于 /usr/local/cuda-6.5/bin/nvcc 位置的 nvcc

我正在属性中搜索,但找不到在哪里执行此操作。

有人有想法吗?谢谢

关于c++ - CUDA 缺少 host_defines.h centos 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28815117/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com