Is it important to fix this warning message "ptxas warning"?


I got a warning message.

The message is

ptxas warning : Stack size for entry function '_Z14finding_blocksi16gpu_meta_handler21gpu_indicator_handlerPb' cannot be statically determined

I allocate to GPU memory and then check the allocation address in create() function.
(allocation address is printed in create() function)

but when I call the operation() function in a kernel, the allocation address is out of bounds.
(allocation address is not printed in operation() function)

unsigned long long int *gpu_bitarray is a global variable.

void create(size_t _num_nodes)	{
		printf("GPU bitvector create\n");

		err = cudaMalloc(&gpu_bitarray, sizeof(unsigned long long int) * size_array);
		if (err != cudaSuccess) {
			fprintf(stderr, "Failed to allocate gpu_bitarray (error code %s)!\n", cudaGetErrorString(err));

		err = cudaMemset(gpu_bitarray, 0, sizeof(unsigned long long int) * size_array);
		if (err != cudaSuccess) {
			fprintf(stderr, "Failed to set gpu_bitarray to 0 (error code %s)!\n", cudaGetErrorString(err));

		printf("gpu_bitarray: %p\n", gpu_bitarray);

printed gpu_bitarray address

__global__ void setting_startnode (unsigned long long int startnode, gpu_bitattribute_handler * visit_attribute) {
	int tid = threadIdx.x + blockIdx.x * blockDim.x;

	if (tid == 0) {
__device__ bool operation(unsigned long long int nodenumber)	{

		printf("gpu_bitarray: %p\n", gpu_bitarray);

no printed gpu_bitarray address

so I think “ptxas warning” got a problem.
it means create() function has gpu_bitarray address, but throw away after create() function.

While that is not the root cause of the warning, you have created a memory leak.

With GPUs designed to run millions of threads, you will quickly drain the entire available heap on the device if each thread leaks a memory allocation.

thank you!