Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory GPU leak, possibly with Caffe services #12

Closed
beniz opened this issue Jun 11, 2015 · 2 comments
Closed

Memory GPU leak, possibly with Caffe services #12

beniz opened this issue Jun 11, 2015 · 2 comments

Comments

@beniz
Copy link
Collaborator

beniz commented Jun 11, 2015

There is a weird leak behavior with Caffe:

  • the first service running Caffe almost determines the leak by leaving a leak behind. The size of the leak is directly proportional to the size of the training dataset
  • the leak appears to be independent from the input connector (witnessed for both CSV and text)
  • leak grow slowly with every new service, proportionally to initial size. This suggests that a structure somewhere is being incremented, with initial size set by the first run service.

First set of investigations appears to rule out the Caffe's net destruction, and first valgrind pass does not reveal much yet.

@beniz beniz added the type:bug label Jun 11, 2015
@beniz beniz self-assigned this Jun 11, 2015
@beniz
Copy link
Collaborator Author

beniz commented Jun 12, 2015

Two points:

  • leak is only visible with GPU
  • in CPU-only mode, valgrind reports no leak
  • in GPU-only mode, valgrind reports large chunks held by CUDA (libcuda.so), this is also visible while running with nvidia-smi.

Typical used memory values on a 4GB GPU during a run:
before start: 152MB
training start: 198MB
training: 589MB
training finished, net is up for prediction: 436MB
service destruction: 200MB
server termination: 152MB

Caffe is allocating some GPU data and not releasing it or there's a way to clear the GPU memory overhead after using it within a net with Caffe.

@beniz beniz changed the title Memory leak, possibly with Caffe services Memory GPU leak, possibly with Caffe services Jun 12, 2015
@beniz
Copy link
Collaborator Author

beniz commented Oct 6, 2015

There were a stream of recent changes in Caffe memory allocation and I cannot reproduce this issue anymore. Closing for now.

@beniz beniz closed this as completed Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant