-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Error with cudaFreeHost(ptr) in syncedmem.hpp:30 #3053
Comments
I get the same error in Python 2.7:
On Ubuntu 14.04, NVIDIA 346.82, Cuda 7. The error is encountered after the exit command. |
I've seen this before as well as a crash whenever a net is deleted after a predict. This not guaranteed to help you immediately, but you may want to try to get your Caffe tree back to one of these two commits and try your code again: Hopefully, one of the versions above will work for you, thus helping to pinpoint the issue. EDIT: d2f0457 that activates pinned memory is crashing some of my setups at Net destruction, and this looks similar to the problem reported in this issue. Reverting the commit clears the bug. |
I think we have a bug here. I'll try to look into this today. |
@hberntsen @beniz I just took a look today. Can you reproduce the same error if you run
Right now the mode is not (but actually should be) an attribute of the net that is set up during creation (just like phase), since in CPU mode |
One solution is to always use
Alternatively, we can also add mode to be an attribute of net, but that involves more hacking at the cost of interface change and at risk of introducing new mistakes. |
@ronghanghu I believe this is indeed a good catch, thanks for the quick reaction! Though I cannot test-run immediately, my code appears to be calling
If this gives the ability to have multiple nets in memory, some using CPU, some using GPU, as a user of the caffelib, I would rate it as a very good feature to conserve (since as far as I understand, this was working prior enforcing the use of `cudaMallocHost'). |
Eventually we would like to give mode and device to net and layers, in the spirit of #1500. However, although mode/device is right now not a member of Net and Layer and thus changable in runtime, it is better to set them in advance and not change them during a lifecycle of a net. |
@ronghanghu In that case the error is does not appear. So setting the mode to GPU before loading the net circumvents the error. |
I use caffe.Classifier to contruct the net, not caffe.Net. So when I use
or
this error is still there. I will try suggested commits above. Thanks. |
I also test on GPUs with and without connected monitor to see if it is the problem of freeing in-use GPU memory. Still got the error. |
@LiberiFatali I could not reproduce your mistake (here is the code snap I used).
It doesn't produce any error on a BVLC machine. Can you try out this code snap on your machine? |
@ronghanghu Above codes work well on my machine. Setting mode gpu before creating the net solves it now. |
I have exactly the same issue when cleaning up network instances in Matlab with call to |
I put the setmode before net creation. But i got this error still. |
@cheer37 ,have you fix the problem ,i did not use the latest PR of caffe,and i get the same error |
@ucasqcz have you fix the problem, i get the same error |
In my case, when caffe model finishs predicting an image. There is the below error:
F0910 15:09:52.590445 21913 syncedmem.hpp:30] Check failed: error == cudaSuccess (11 vs. 0) invalid argument
*** Check failure stack trace: ***
Aborted
It comes from CUDA_CHECK(cudaFreeHost(ptr)); in syncedmem.hpp.
Everything else works well. Any ideas for fixing this? I use latest code in the master.
I'm using Ubuntu 14.04, NVIDIA driver 352.41, Cuda 7.5 and CuDNN v2.
The text was updated successfully, but these errors were encountered: