thu-pacman/HyQuas

Encountered an error when running preprocess.sh

flyree opened this issue · 4 comments

Hi,

I am trying to run the simulation on a standalone GPU, but I am not sure what configurations I should change (BACKEND?).

While I was compiling it with the default configuration (of course those CUDA path, NCCL path etc. are edited for my environment), I ran into this issue:

~/HyQuas/benchmark$ ./preprocess.sh
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-7.5.0/gcc-9.4.0-isf6jz5m5sfovhamq5jpgwscfb5toli6/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-7.5.0/gcc-9.4.0-isf6jz5m5sfovhamq5jpgwscfb5toli6/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.4.0/cuda-11.4.0-onh3v43dbp6afwelenl4ru6viv37amch (found version "11.4")
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Using nccl library: /hpc/home/fang587/nccl/build/lib/libnccl_static.a
-- Found Nccl: /hpc/home/fang587/nccl/build/include
-- Found MPI_C: /hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.4.0/openmpi-4.1.1-dlb4sbxk4fugkri6w7cmvnijy5snbrhg/lib/libmpi.so (found version "3.1")
-- Found MPI_CXX: /hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.4.0/openmpi-4.1.1-dlb4sbxk4fugkri6w7cmvnijy5snbrhg/lib/libmpi.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Found CUTT: /hpc/home/fang587/HyQuas/third-party/cutt/cutt/lib/libcutt.a
-- Backend: group
-- Float type: Double
-- coalesce = 3
-- mat size = 7
-- min mat size = 4
-- thread_dep = 7
-- Configuring done
-- Generating done
-- Build files have been written to: /hpc/home/fang587/HyQuas/build
[ 4%] Building NVCC (Device) object src/CMakeFiles/QCSimulator.dir/QCSimulator_generated_kernelOpt.cu.o
[ 8%] Building NVCC (Device) object src/CMakeFiles/QCSimulator.dir/QCSimulator_generated_kernelUtils.cu.o
[ 12%] Building NVCC (Device) object src/CMakeFiles/QCSimulator.dir/QCSimulator_generated_kernelSimple.cu.o
/hpc/home/fang587/HyQuas/third-party/dbg-macro/dbg.h(39): remark: #pragma message: "WARNING: the 'dbg.h' header is included in your code base"

ptxas info : 22 bytes gmem
ptxas info : Compiling entry function '_Z15whileTrueKernelv' for 'sm_70'
ptxas info : Function properties for _Z15whileTrueKernelv
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 4 registers, 352 bytes cmem[0]
ptxas info : Compiling entry function '_Z17printVectorKernelP7double2i' for 'sm_70'
ptxas info : Function properties for _Z17printVectorKernelP7double2i
16 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 30 registers, 364 bytes cmem[0]
ptxas info : Compiling entry function '_Z15isnanTestKernelP7double2i' for 'sm_70'
ptxas info : Function properties for _Z15isnanTestKernelP7double2i
8 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 25 registers, 364 bytes cmem[0]
/hpc/home/fang587/HyQuas/src/./kernelOpt.cu(459): warning: variable "delta" was declared but never referenced

ptxas info : 0 bytes gmem
ptxas info : Compiling entry function '_Z6reduceILj128EEvPdS0_jj' for 'sm_70'
ptxas info : Function properties for _Z6reduceILj128EEvPdS0_jj
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 16 registers, 1024 bytes smem, 376 bytes cmem[0]
ptxas info : Compiling entry function '_Z7measureILj128EEvP7double2Pdii' for 'sm_70'
ptxas info : Function properties for _Z7measureILj128EEvP7double2Pdii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 16 registers, 1024 bytes smem, 376 bytes cmem[0]
ptxas info : Compiling entry function '_Z8RZKernelILj128EEvP7double2iidd' for 'sm_70'
ptxas info : Function properties for _Z8RZKernelILj128EEvP7double2iidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 22 registers, 384 bytes cmem[0]
ptxas info : Compiling entry function '_Z8RYKernelILj128EEvP7double2iidd' for 'sm_70'
ptxas info : Function properties for _Z8RYKernelILj128EEvP7double2iidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 24 registers, 384 bytes cmem[0]
ptxas info : Compiling entry function '_Z8RXKernelILj128EEvP7double2iidd' for 'sm_70'
ptxas info : Function properties for _Z8RXKernelILj128EEvP7double2iidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 22 registers, 384 bytes cmem[0]
ptxas info : Compiling entry function '_Z7TKernelILj128EEvP7double2iid' for 'sm_70'
ptxas info : Function properties for _Z7TKernelILj128EEvP7double2iid
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 12 registers, 376 bytes cmem[0]
ptxas info : Compiling entry function '_Z7SKernelILj128EEvP7double2ii' for 'sm_70'
ptxas info : Function properties for _Z7SKernelILj128EEvP7double2ii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 14 registers, 368 bytes cmem[0]
ptxas info : Compiling entry function '_Z7ZKernelILj128EEvP7double2ii' for 'sm_70'
ptxas info : Function properties for _Z7ZKernelILj128EEvP7double2ii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 10 registers, 368 bytes cmem[0]
ptxas info : Compiling entry function '_Z7YKernelILj128EEvP7double2ii' for 'sm_70'
ptxas info : Function properties for _Z7YKernelILj128EEvP7double2ii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 26 registers, 368 bytes cmem[0]
ptxas info : Compiling entry function '_Z7XKernelILj128EEvP7double2ii' for 'sm_70'
ptxas info : Function properties for _Z7XKernelILj128EEvP7double2ii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 18 registers, 368 bytes cmem[0]
ptxas info : Compiling entry function '_Z7HKernelILj128EEvP7double2iid' for 'sm_70'
ptxas info : Function properties for _Z7HKernelILj128EEvP7double2iid
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 22 registers, 376 bytes cmem[0]
ptxas info : Compiling entry function '_Z7UKernelILj128EEvP7double2iidddddddd' for 'sm_70'
ptxas info : Function properties for _Z7UKernelILj128EEvP7double2iidddddddd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 28 registers, 432 bytes cmem[0]
ptxas info : Compiling entry function '_Z8U1KernelILj128EEvP7double2iidd' for 'sm_70'
ptxas info : Function properties for _Z8U1KernelILj128EEvP7double2iidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 14 registers, 384 bytes cmem[0]
ptxas info : Compiling entry function '_Z9CRZKernelILj128EEvP7double2iiidd' for 'sm_70'
ptxas info : Function properties for _Z9CRZKernelILj128EEvP7double2iiidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 22 registers, 392 bytes cmem[0]
ptxas info : Compiling entry function '_Z9CU1KernelILj128EEvP7double2iiidd' for 'sm_70'
ptxas info : Function properties for _Z9CU1KernelILj128EEvP7double2iiidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 14 registers, 392 bytes cmem[0]
ptxas info : Compiling entry function '_Z9CRYKernelILj128EEvP7double2iiidd' for 'sm_70'
ptxas info : Function properties for _Z9CRYKernelILj128EEvP7double2iiidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 24 registers, 392 bytes cmem[0]
ptxas info : Compiling entry function '_Z9CRXKernelILj128EEvP7double2iiidd' for 'sm_70'
ptxas info : Function properties for _Z9CRXKernelILj128EEvP7double2iiidd
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 22 registers, 392 bytes cmem[0]
ptxas info : Compiling entry function '_Z8CZKernelILj128EEvP7double2iii' for 'sm_70'
ptxas info : Function properties for _Z8CZKernelILj128EEvP7double2iii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 10 registers, 372 bytes cmem[0]
ptxas info : Compiling entry function '_Z8CYKernelILj128EEvP7double2iii' for 'sm_70'
ptxas info : Function properties for _Z8CYKernelILj128EEvP7double2iii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 26 registers, 372 bytes cmem[0]
ptxas info : Compiling entry function '_Z10CNOTKernelILj128EEvP7double2iii' for 'sm_70'
ptxas info : Function properties for _Z10CNOTKernelILj128EEvP7double2iii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 18 registers, 372 bytes cmem[0]
ptxas info : Compiling entry function '_Z9CCXKernelILj128EEvP7double2iiii' for 'sm_70'
ptxas info : Function properties for _Z9CCXKernelILj128EEvP7double2iiii
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 18 registers, 376 bytes cmem[0]
/hpc/home/fang587/HyQuas/src/./kernelOpt.cu(246): warning: variable "m" was declared but never referenced
detected during instantiation of "void run(qComplex *, unsigned int *, int *, int *, int, int, unsigned int, unsigned int) [with blockSize=128U]"
(504): here

/hpc/home/fang587/HyQuas/src/./kernelOpt.cu(11): warning: extern declaration of the entity shm is treated as a static definition

/hpc/home/fang587/HyQuas/src/./kernelOpt.cu(12): warning: extern declaration of the entity blockBias is treated as a static definition

ptxas info : 0 bytes gmem, 52808 bytes cmem[3]
ptxas info : Compiling entry function '_Z3runILj128EEvP7double2PjPiS3_iijj' for 'sm_70'
ptxas info : Function properties for _Z3runILj128EEvP7double2PjPiS3_iijj
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 64 registers, 16392 bytes smem, 400 bytes cmem[0], 256 bytes cmem[2]
/hpc/home/fang587/HyQuas/third-party/dbg-macro/dbg.h:39:81: note: #pragma message: WARNING: the 'dbg.h' header is included in your code base
39 | #pragma message("WARNING: the 'dbg.h' header is included in your code base")
| ^
[ 16%] Building CXX object src/CMakeFiles/QCSimulator.dir/executor.cpp.o
[ 20%] Building CXX object src/CMakeFiles/QCSimulator.dir/circuit.cpp.o
[ 25%] Building CXX object src/CMakeFiles/QCSimulator.dir/compiler.cpp.o
[ 29%] Building CXX object src/CMakeFiles/QCSimulator.dir/evaluator.cpp.o
[ 33%] Building CXX object src/CMakeFiles/QCSimulator.dir/gate.cpp.o
[ 37%] Building CXX object src/CMakeFiles/QCSimulator.dir/logger.cpp.o
[ 41%] Building CXX object src/CMakeFiles/QCSimulator.dir/schedule.cpp.o
[ 45%] Building CXX object src/CMakeFiles/QCSimulator.dir/utils.cpp.o
/hpc/home/fang587/HyQuas/src/circuit.cpp:6:10: fatal error: mpi.h: No such file or directory
6 | #include <mpi.h>
| ^~~~~~~
compilation terminated.

It seems that it uses CXX compiler to compile a file that uses MPI.

Actually I do not need MPI. So would it possible that you either point to me how to compile it for the local GPU only, or help me solve this error I encountered? Thank you so much!

The flag for not using mpi can be set by "source ../scripts/init.sh -DUSE_MPI=off". Though it still tries to find mpi.h, the generated binary will not call mpi library. "Backend" refers to several simulation algorithms implemented in the system. Their execution time is different but can produce the same result.
It appears that mpi is already installed on your cluster. You can add the coresponding "mpi.h" to the compiler's include path to compile HyQuas.

Hi Chen,

Thanks for the comment. I actually added the path to "mpi.h" to the top level Makefile as

CXX_FLAGS := -std=c++14 -O2 -g -Wall -I$(CUTT_DIR)/include -Isrc -I$(CUDA_HOME)/include -I/hpc/software/spack/opt/spack/linux-ubuntu18.04-broadwell/gcc-9.4.0/openmpi-4.1.1-dlb4sbxk4fugkri6w7cmvnijy5snbrhg/include

But it still didn't find mpi.h.

Bo

The top level makefile is deprecated. Please modify the CMakeLists.txt instead.

Hi Chen,

yes that works. Thank you!

I think the issue is addressed.

I have started to run a qaoa_30 circuit and I think I will have some questions for clarification later. I will contact you via email. Thanks again for the quick response on this and great work on the simulator!

Bo