0

I have a CUDA NSight project which was compiling fine, but suddenly isn't. I did have some system updates (Ubuntu 18.04) installed last week, which are likely the cause (or a part of it). Unfortunately I don't know what exactly was installed. I don't recall seeing any CUDA things in the list.

Anyway, the nvcc command line created by Nsight is as follows:

/usr/local/cuda-10.2/bin/nvcc -I/usr/include/gdal -O2 --compile --relocatable-device-code=false -gencode arch=compute_37,code=compute_37 -gencode arch=compute_61,code=compute_61 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_61,code=sm_61  -x cu -o  "MySource.o" "../MySource.cu"

This gives a bunch of very similar errors, starting:

/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(1761): error: identifier "__builtin_ia32_sqrtsd_round" is undefined

/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(1770): error: identifier "__builtin_ia32_sqrtss_round" is undefined

/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(2728): error: identifier "__builtin_ia32_scalefsd_round" is undefined

/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(2737): error: identifier "__builtin_ia32_scalefss_round" is undefined

avx512fintrin.h does indeed exist at the quoted location and has a date stamp back in December.

I am running Ubuntu 18.04 x64. gcc and g++ are both reporting as: 7.5.0

Running CUDA 10.2 (and confirmed by nvidia-smi). nvcc --version reports release 10.2 V10.2.89

Building the cuda-10.2/samples/0_Simple/matrixMul sample (with make), builds with no errors.

Where are the identifiers in the errors defined? What am I missing? What has changed or been corrupted?

5
  • "Unfortunately I don't know what exactly was installed" there are ways to find that out.
    – talonmies
    Commented Mar 24, 2020 at 5:16
  • There is something wrong with the setup (incompatible versions of things?), but as a workaround, I'd try removing the #include <x86intrin.h> in /usr/include/gdal/cpl_port.h, which doesn't seem to be used for anything... Commented Mar 24, 2020 at 11:50
  • @talonmies Thanks. I've since found two Google Compute instances are doing the same. So I tried those methods there (less likely to be a broken install). They're updating almost daily so there's a lot to wade through - Linux headers, glib, etc. I think it is a matter of detective work with my build options & includes
    – winwaed
    Commented Mar 24, 2020 at 13:29
  • @Marc Glisse I'm not seeing any gdal updates on the google instances; but broken gdal installs are a problem I've seen before. Could be a manual update is required.
    – winwaed
    Commented Mar 24, 2020 at 13:32

1 Answer 1

3

I believe I have found the problem. @Marc Glisse 's comment about GDAL was a big clue. I am using nvcc to compile everything. For standard C++ this just passes the work to g++. I also had the same include paths. The GDAL C++ interface (which I'm using) cannot, of course, be called directly from CUDA. Removing the GDAL include path from CUDA nvcc, and re-arranging the include files fixed the problem.

A nice side effect is that it has forced me to greatly improve my include file hygiene!

Takeaway: With the latest Linux updates, GDAL includes don't even like to be included in CUDA code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.