dynamic parallelism with cmake

hello…
I have been trying to compile a .cu file which consist of a parent kernel and a child kernel using cmake;

my .cu file:
global void childKernel()
{
printf("Hello ");
}

global void parentKernel()
{

childKernel<<<1,5>>>();
cudaDeviceSynchronize();

printf(“World!\n”);
}

my cmake file:

find_package(CUDA QUIET REQUIRED)

include_directories(/usr/include)
include_directories(/usr/local/cuda/lib)

    set(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_PROPAGATE_HOST_FLAGS OFF)

set(CUDA_NVCC_FLAGS "-arch=compute_53;-code=sm_53; -rdc=true -O3" )

set(PROJECT_LINK_LIBS  -L/usr/local/cuda/targets/armv7-linux-gnueabihf/lib -lcudadevrt -L/usr/local/cuda/targets/armv7-linux-gnueabihf/lib -lcublas -L/usr/local/cuda/targets/armv7-linux-gnueabihf/lib -lcublas_device)

    target_link_libraries(DRA ${PROJECT_LINK_LIBS}  ${CUDA_LIBRARIES})

when i compile the files using the command make I don’t get any error but when i run the .out file the kernels are not launched.

I am not able to find where the error/bug is

When i compile the same file directly on the terminal using:

nvcc -arch=compute_53 -code=sm_53 -rdc=true helloworld.cu -o hello -lcudadevrt

it works fine

hello,

I am also facing the same issue…

i am setting flags in cmake as

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} “-arch=compute_53 -code=sm_53 -rdc=true -O3” )

and i set set(CUDA_VERBOSE_BUILD ON)

i think -arch=compute_53 -code=sm_53 -rdc=true -O3 flags are being passed to /usr/bin/cc instead of nvcc and that’s why kernel is not getting launched because of absence of dynamic parallelism flags.

Any insight is highly appreciated…

I’m not particularly using cmake other than when existing code forces it on me, but what output do you get when running

make VERBOSE=1

? That should be the first step in diagnosing the problem.