Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Compilation with CUDA fails (Linux; GCC) #46

Closed
4re opened this issue Nov 20, 2017 · 16 comments
Closed

Compilation with CUDA fails (Linux; GCC) #46

4re opened this issue Nov 20, 2017 · 16 comments

Comments

@4re
Copy link

4re commented Nov 20, 2017

Here is the build log https://gist.githubusercontent.com/4re/45b8a76ad38abee2cc4fbe636182f130/raw/002930fe8c69e28ce0333438052bbedfb109d0f0/error.log

@DeadSix27
Copy link
Owner

see: #35

@4re
Copy link
Author

4re commented Nov 21, 2017

I think this is not the same bug. I was getting #35 as well but it looks like I have a different one in addition.

Just to be safe about it I applied all the changes proposed in #35 to no avail.

The relevant lines in the log are:

/usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

/usr/include/bits/floatn.h(73): error: identifier "__float128" is undefined

This is the log with the patch applied.

gcc versión 6.4.0 (Gentoo 6.4.0 p1.1)
cmake version 3.9.6
opencv_version 3.3.0
nvidia-cuda-toolkit-9.0.176

@4re
Copy link
Author

4re commented Nov 21, 2017

And this is the patch cuda.diff just in case.

@DeadSix27
Copy link
Owner

DeadSix27 commented Nov 21, 2017

Some of your issues appear here: facebookarchive/caffe2#1194

he said that "CUDA package on Arch Linux received a fix to be able to work with glibc 2.26. It works nice for me after the fix."

EDIT: I know you're not on arch, just saying.

To me it looks like /usr/include/bits/floatn.h(61): error: invalid argument to attribute "__mode__"

indicates its not waifu2x's problem..

/var/tmp/portage/media-libs/waifu2x-converter-cpp-5.2/work/waifu2x-converter-cpp-5.2/src/modelHandler_CUDA.cu(480): warning: function "__shfl_down(float, unsigned int, int)"

Is just a deprecation warning though

@DeadSix27
Copy link
Owner

also check this out: https://www.xpra.org/trac/ticket/1600

@4re
Copy link
Author

4re commented Nov 21, 2017

I see, thank you for pointing me in the right direction. In the end, it is a CUDA bug and seeing as they ignored it from their 8.0 release until now I see little hope in them.

@4re 4re closed this as completed Nov 21, 2017
@DeadSix27
Copy link
Owner

@4re I am not sure tbh Some ppl got this to compile fine with cuda 9.0 I think, did you try that?

@4re
Copy link
Author

4re commented Nov 21, 2017

I patched my system files with the changes suggested and it compiled and worked fine.
I tested it and I can correctly process images with the CUDA backend.

I'm maintaining a Gentoo overlay and wanted to offer your package with proper CUDA support, but seeing as I would have to provide patched builds for sys-libs/glibc and nvidia-cuda-toolkit (if I want it to work with GCC 7), it is just too ugly and bothersome. Also, I don't think this would appeal to the users.

I will go with CUDA support disabled by the time being and revert back if they properly fix it.

Thank you again for all your help here.

@DeadSix27
Copy link
Owner

@4re Good to see you got it working though, that means it's not w2x's problem at least.

But this is only an issue on GCC7 or CUDA8, does CUDA9 + GCC7 work?

@4re
Copy link
Author

4re commented Nov 21, 2017

I have only tested it with nvidia-cuda-toolkit-9.0.176 and sys-devel/gcc-7.2.0 / sys-devel/gcc-6.4.0. All of them were having this problem and this changes fixed them.

I can test other combinations if you are interested.

@4re
Copy link
Author

4re commented Nov 21, 2017

Note that to use GCC7 with CUDA9 you need to patch CUDA9.

@DeadSix27
Copy link
Owner

Waifu2x will need the patches for cuda9, that's fine.

I'm just curious if there is a combination that does not require CUDA or GCC to be patched.

@4re
Copy link
Author

4re commented Nov 21, 2017

CUDA9 with =<GCC6 works without patching.

@DeadSix27
Copy link
Owner

DeadSix27 commented Nov 21, 2017

@4re Did you come across any bug reports that can be linked here to see when it's fixed?

EDIT: And did you check if ark maintainers have patches applied ?

@4re
Copy link
Author

4re commented Nov 23, 2017

Ark maintainers are patching CUDA SDK.

I don't know of any ticket related to this bug. If I find any I will link it here.

@sl1pkn07
Copy link

sl1pkn07 commented May 27, 2018

just note, is offtopic, but can help it.

with mxnet fail build if use certain GCC + CUDA

with

cuda 9.1.85.3 build OK with GCC 5.4.1 and GCC 6.3.1, but fails with GCC 5.5.0, GCC 6.4.1, and GCC 7.3.1

the same code with

cuda 9.2.88.1 build OK with GCC 7.3.1, and, in assumition, with GCC 5.4.1 and GCC 6.3.1

seems cuda needs use a certain GCC to work. the official list is:

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements

use other compiler than posted in the documentation can lead to fail

[NOTE] i have cuda patched with https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/cuda#n67

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants