New thread which get the forward instance constructed by main thread cannot use GPU #5744

Open
fengshikun opened this Issue Jul 6, 2017 · 0 comments

Comments

Projects
None yet
1 participant

fengshikun commented Jul 6, 2017 edited

Issue summary

I construct a new classification forward instance in main thread like this:

// construct a new forward class
Caffe::set_mode(Caffe::GPU);
net_.reset(new Net(model_file, TEST));
net_->CopyTrainedLayersFrom(trained_file);

and pass this instance to a new thread to do forward. but this new thread failed to use GPU.

from #4178,
I add Caffe::set_mode(Caffe::GPU); before each forward operation, but it will complains:

gpu_memory.hpp:90 Check failed: 'prt_' Must be non NULL.

How to reset the GPU configuration to make it normal, thanks!

Your system configuration

Operating system: Ubuntu16.06 with CUDA8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment