试图获得CUDA 7.5与GCC 5.x一起使用 [英] Trying to get CUDA 7.5 to work with GCC 5.x

查看:1126
本文介绍了试图获得CUDA 7.5与GCC 5.x一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,如果你尝试使用nvcc当系统GCC是版本5及以上,你会得到一个不支持的版本的错误。但是 - 我听说有人报告他们刚刚评论过这一点,CUDA 7.5为他们工作与GCC 5.x。



当我做同样,但是(检查是在 $ CUDA_DIR / host_config.h ),并编译的东西,我得到以下错误:

  /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/mwaitxintrin.h(36):错误:标识符__builtin_ia32_monitorx未定义
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/mwaitxintrin.h(42):错误:标识符__builtin_ia32_mwaitx未定义

和一堆其他人,但那些可能依赖于这些。现在,这些是与X86架构相关的MMX相关内在函数。我不直接使用它们,所以我猜他们选择了。也许这可以避免?



有没有办法克服这些错误,实际上让GCC 5与CUDA 7.5共存?




    $ b b
  • 我已阅读过建议使用 -D__STRICT_ANSI __

  • 我在Fedora 22上以防万一。


解决方案

我认为一个 -D_MWAITXINTRIN_H_INCLUDED 选项应该解决这个问题。实际上我采用了一个稍微不同的方法,注释 #include x86intrin.h ,并使用CUDA 7.5和GCC 5.2.1成功构建了TensorFlow。



UPDATE



对于最新版本的TensorFlow(v0.8.0),只需在调用 configure 脚本时选择使用gcc 4.x。


So, if you try to use nvcc when the system GCC is version 5 and up, you get an "unsupported version" error. But - I've heard people report that they've just commented this out and that CUDA 7.5 "works for them" with GCC 5.x .

When I do the same, however (the check is in $CUDA_DIR/host_config.h), and compile something, I get the following errors:

/usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/mwaitxintrin.h(36): error: identifier "__builtin_ia32_monitorx" is undefined
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined

and a bunch of others, but those may be dependent on these. Now, these are MMX-related intrinsics for X86 architectures. I don't use them directly, so I'm guessing they're opted-in somehow. Perhaps this can be avoided?

Is there a way to overcome these errors and actually get GCC 5 to coexist with CUDA 7.5? And for code to build and run?

Notes:

  • I've read a suggestion to use -D__STRICT_ANSI__. I have, and it doesn't seem to help.
  • I'm on Fedora 22 in case it matters.

解决方案

I think a -D_MWAITXINTRIN_H_INCLUDED option should fix the issue. Actually I employed a slightly different approach, commenting out the #include <mwaitxintrin.h> line in x86intrin.h, and successfully built TensorFlow with CUDA 7.5 and GCC 5.2.1.

UPDATE

For the latest version of TensorFlow (v0.8.0), simply choose to use gcc 4.x when invoking the configure script.

这篇关于试图获得CUDA 7.5与GCC 5.x一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆