leak in cublasCreate + cublasDestroy?

cublasHandle_t handle;
    size_t size;
    cudaMemGetInfo(&size, nullptr);
    std::cout << size << std::endl;

    cudaMemGetInfo(&size, nullptr);
    std::cout << size << std::endl;

    cudaMemGetInfo(&size, nullptr);
    std::cout << size << std::endl;

this outputs


Geez… I was pursuing this leak for a whole week.
When will this be fixed?

That doesn’t look like a leak to me. The library has overhead which will be incurred the first time you use it. In addition, cublasCreate will have some temporary storage associated with it, which will be released when you do cublasDestroy. But that doesn’t mean you get the library overhead back.

You’re just witnessing two different kinds of overhead associated with using cublas library.

A leak would be successive reduction in free memory as you do a create/destroy cycle over and over again.

Also, I would always recommend indicating the CUDA version you are using as well as the platform you are running on.

CUDA version is 9.0
GTX1080 GPUs,
Ubuntu Linux 14.04

By overhead do you mean memory overhead?

Yes, memory overhead.

Initialization of the library involves memory utilization.

That memory will never be returned to the application.

Furthermore, creating a handle will involve memory utilization.

That memory can be returned by destroying the handle.

Oh. I see! Sorry for the hassle. I’ll modify my leak detection system