anilshanbhag / crystal

GPU library for writing SQL queries
MIT License
64 stars 20 forks source link

Compilation issue #1

Closed dkoutsou closed 4 years ago

dkoutsou commented 4 years ago

Hey,

I am trying to compile the ops package. My cuda version is 10.2 and my gcc version is 7.5. My OS is Ubuntu 18.04.4.

I first run make setup to download the cub package.

Then I run make bin/ops/project but I receive the following compilation error:

-> % make bin/ops/project
nvcc -lcurand -gencode=arch=compute_52,code=\"sm_52,compute_52\" --std=c++11 -DSM520 -Xptxas="-dlcm=cg -v" -lineinfo -Xcudafe -#  -Icub/ -Icub/test -I. -I  -O3 -dc src/ops/project.cu -o obj/ops/project.o
./crystal/store.cuh(43): error: no instance of overloaded function "BlockStoreDirect" matches the argument list
            argument types are: (const unsigned int, float *, float [4])
          detected during:
            instantiation of "void BlockStore<T,BLOCK_THREADS,ITEMS_PER_THREAD>(T *, T (&)[ITEMS_PER_THREAD], int) [with T=float, BLOCK_THREADS=128, ITEMS_PER_THREAD=4]"
src/ops/project.cu(53): here
            instantiation of "void project<BLOCK_THREADS,ITEMS_PER_THREAD>(float *, float *, float *, int) [with BLOCK_THREADS=128, ITEMS_PER_THREAD=4]"
src/ops/project.cu(91): here

./crystal/store.cuh(45): error: no instance of overloaded function "BlockStoreDirect" matches the argument list
            argument types are: (const unsigned int, float *, float [4], int)
          detected during:
            instantiation of "void BlockStore<T,BLOCK_THREADS,ITEMS_PER_THREAD>(T *, T (&)[ITEMS_PER_THREAD], int) [with T=float, BLOCK_THREADS=128, ITEMS_PER_THREAD=4]"
src/ops/project.cu(53): here
            instantiation of "void project<BLOCK_THREADS,ITEMS_PER_THREAD>(float *, float *, float *, int) [with BLOCK_THREADS=128, ITEMS_PER_THREAD=4]"
src/ops/project.cu(91): here

Front end time                       0.53 (CPU)       0.00 (elapsed)
2 errors detected in the compilation of "/tmp/tmpxft_000073c1_00000000-6_project.cpp1.ii".
Total compilation time               0.53 (CPU)       0.00 (elapsed)
Makefile:24: recipe for target 'obj/ops/project.o' failed
make: *** [obj/ops/project.o] Error 1

I have also tried to compile with cuda 9.1 but the error still persists.

I would appreciate any help!

anilshanbhag commented 4 years ago

Fixed in 855f8e2 Can you pull and try again ?

dkoutsou commented 4 years ago

Thanks this worked.

However I see in your makefile you have an undefined variable $(CPU_ARCH). For example when I try to compile the join operator I am receiving the following error:

-> % make bin/ops/join
nvcc -lcurand -gencode=arch=compute_52,code=\"sm_52,compute_52\"  --std=c++11 -DSM520 -Xptxas="-dlcm=cg -v" -lineinfo -Xcudafe -#   -Icub/ -Icub/test -I. -I  -O3 -dc src/ops/join.cu -o obj/ops/join.o
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(11265): error: identifier "__builtin_ia32_scalefsd_round" is undefined

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

Front end time                       0.73 (CPU)       1.00 (elapsed)
2 errors detected in the compilation of "/tmp/tmpxft_0001766c_00000000-6_join.cpp1.ii".
Total compilation time               0.73 (CPU)       1.00 (elapsed)
Makefile:28: recipe for target 'obj/ops/join.o' failed
make: *** [obj/ops/join.o] Error 1

This is because my processor does not support AVX512 instructions. Trying to put flags like -march=native didn't work as you cannot mix cuda with gcc very easily. Can you share what you are using to compile the code?

Any help would be appreciated. Thanks!

anilshanbhag commented 4 years ago

That's strange, I am not getting the error. Saw a few threads, on asked to remove -march=native, which is not being used. I am using CUDA 10.1, gcc 8.3, Ubuntu 16.04

avx512fintrin.h is coming from immintrin.h in utils/generator.h. Can you just try running a program with immintrin.h - like from here https://www.cs.uaf.edu/courses/cs441/notes/avx/ ?

dkoutsou commented 4 years ago

Sorry for the late reply.

I updated to gcc-8 and now the code compiles. For accounting reasons, my setup is Ubuntu 18.04, gcc 8.4, CUDA 10.2. I will leave this open, because I may have some questions for the interpretation of the join numbers, if this is not a problem and I will close in a few days.