The executable runtime shows that the file has been compiled

The executable runtime shows that the file has been compiled
I would like to ask you, my program uses the makefile file compilation, there is no problem with compilation, but the following problem occurs when running:

Current file:     /home/orin/Desktop/1212/ZDSN1127/src/process.c
        function: _Z24GenerateReplicatesSignalP13cublasContextididdddddiiiPfP6float2
        line:     2147
This file was compiled: -acc=gpu -gpu=cc80 -gpu=cc87 -acc=host or -acc=multicore
Rebuild this file with -gpu=cc87 to use NVIDIA Tesla GPU 0

Here’s the compilation instructions for my makefile file:

process:process.o  cudaCode.o
    nvc++ -acc -gpu=cc87 -fast -cuda -cudalib -std=c++17 -Minfo=accel -lnppig -lnppc -lnppisu -lnppidei    -o process   process.o cudaCode.o
process.o:process.c
    nvc++ -fast -acc -gpu=cc87 -std=c++17 -cudalib -c process.c
cudaCode.o:cudaCode.cu
    nvcc -c cudaCode.cu

datapack.o:datapack.c
    nvc++ -c datapack.c -o datapack.o

CircularBuffer.o:CircularBuffer.c
    nvc++ -c CircularBuffer.c -o CircularBuffer.o

CircularBufferSpliceData.o:CircularBufferSpliceData.c
    nvc++ -c CircularBufferSpliceData.c -o CircularBufferSpliceData.o

Resample.o:Resample.cu
    nvc++ -c Resample.cu -o Resample.o

FFTuse.o:FFTuse.c
    nvc++ -c -cuda -cudalib FFTuse.c -o FFTuse.o

macros.o:macros.c
    nvc++ -c macros.h -o macros.o
    
base_function.o:base_function.c
    nvc++ -c base_function.c -o base_function.o
clean:
    rm -f process.o cudaCode.o

My best guess is that it’s due to the mixing of nvcc compiled CUDA code with nvc++ compiled OpenACC code. nvcc disables relocatable device code (RDC) by default while it’s enabled by default with nvc++.

nvc++ does have limited support for CUDA, so depending on how your “cudaCode.cu” file is written, you can try compiling it using “nvc++ -c -cuda cudaCode.cu”.

Another option would be to disable RDC with nvc++ by using the flag “-gpu=cc87,nordc”.

Thank you very much, I’ve solved this problem using your method

I’d like to ask about the reason for this, as I didn’t have this with my previous compilation

The reason for the original error? Again I can’t be sure since you didn’t provide a minimal reproducing example, but it’s likely due to RDC. A program either needs to be compiled with or without RDC not both as you have above.