Ask Your Question
0

cuda 9 nvcc issue

asked 2017-12-01 04:26:38 -0600

chaitanyacix gravatar image

I recently upgraded to fedora 27, I installed Nvidia Drivers 387.22 cuda toolkit 9 After switching to gcc-c++ 5.3 and while trying to compile (make) cuda-samples the process exits with errors

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "_mode" /usr/include/bits/floatn.h(73): error: identifier "float128" is undefined /usr/include/bits/floatn.h(61): error: invalid argument to attribute "mode" /usr/include/bits/floatn.h(73): error: identifier "float128" is undefined /usr/include/bits/floatn.h(61): error: invalid argument to attribute "mode" /usr/include/bits/floatn.h(73): error: identifier "float128" is undefined 2 errors detected in the compilation of "/tmp/tmpxft0000130c00000000-6matrixMulkernel.cpp1.ii". make[1]: * [Makefile:321: matrixMulkernel64.ptx] Error 1 make[1]: Leaving directory '/home/chaitanya/cuda-samples/NVIDIACUDA-9.0Samples/0Simple/matrixMulDrv' make: * [Makefile:52: 0Simple/matrixMulDrv/Makefile.phbuild] Error 2 make: * Waiting for unfinished jobs.... /usr/include/bits/floatn.h(61): error: invalid argument to attribute "mode" /usr/include/bits/floatn.h(73): error: identifier "float128" is undefined /usr/include/bits/floatn.h(61): error: invalid argument to attribute "mode" /usr/include/bits/floatn.h(73): error: identifier "float128" is undefined 2 errors detected in the compilation of "/tmp/tmpxft0000130600000000-12simpleCubemapTexture.compute70.cpp1.ii". 2 errors detected in the compilation of "/tmp/tmpxft0000132000000000-12simplePitchLinearTexture.compute_70.cpp1.ii".**

I tried the same with even older gcc 4.9 and the newer 6.3 the error remains. is there any way to fix this. in earlier set up on my fedora 26 cuda 8 and switching to gcc 4.9 everything used to work very well. or any other set up ? please advice

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-01-20 06:02:19 -0600

So I had this issue and found a solution I was happy with. If you open the header file cuda/include/host_defines.h and add this to the bottom:

#define _BITS_FLOATN_H

It fixes the issue, and you don't have to patch bits/floatn.h which could be removed after an upgrade!

edit flag offensive delete link more
0

answered 2017-12-01 05:47:25 -0600

chaitanyacix gravatar image

Short-circuiting the __FLOAT128 in /usr/include/bits/floatn.h works as mentioned in https://devtalk.nvidia.com/default/to... but is there any better way??

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-12-01 04:26:38 -0600

Seen: 400 times

Last updated: Dec 01 '17