-
Notifications
You must be signed in to change notification settings - Fork 263
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
Fix potential CNMEM_NOT_INITIALIZED errors #26
Conversation
@@ -229,6 +229,9 @@ class MemoryHandlerActivator { | |||
using_pool_ = true; | |||
MemoryHandler::usePool(); | |||
MemoryHandler::setGPUs(gpus); | |||
void* temp; | |||
MemoryHandler::mallocGPU(&temp, 4); | |||
MemoryHandler::freeGPU(temp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably warrants an explanatory comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be wrapped in a #ifndef CPU_ONLY
(or #ifdef USE_CNMEM
) for the CPU-only build.
This fixed my HDF5Data layer runtime error - thanks! But now the tests are failing hard (https://travis-ci.org/NVIDIA/caffe/builds/77675932), and they even fail for me when I build with cuDNN and CNMeM (with 6,000+ lines of stderr output!). Can you verify this? It's not clear to me why such a small change would affect the tests so dramatically. |
It looks like the TravisCI builds are failing to build Caffe, whereas on my machine I'm failing to build the tests. |
The tests are completely unchanged -- they don't use the memory pool at all. Only time I've seen something similar it ended up being a bug in gcc -- moving to something newer (in my case from gcc 4.6 -> 4.9) fixed the issue for me |
Well that seems like a giant test hole then! Looking into the gcc version now ... |
I have gcc version 4.8.4 - I don't think it's a gcc problem. But it does seem to be a CMake problem (make works fine), and I'm seeing it with For this pull reqeuest, can you add the |
dummy alloc / free in MemoryHandlerActivator to ensure that the memory pool has been set up before any potential operations
Added the #ifndef guard and squashed commits |
Ok great, that fixed the Travis tests. Thanks! |
Fix potential CNMEM_NOT_INITIALIZED errors
Tagged as |
Ok, sounds good. |
dummy alloc / free in MemoryHandlerActivator to ensure that
the memory pool has been set up before any potential operations