I am training neural nets with theano and lasagne on a 4 GPU machine. My .theanorc
contains the following lines:
[global]
device = gpu0
So when in python I execute import theano
, I get Using gpu device 0: GRID K520
What if, after importing theano, I chose to use say gpu1? I'd like to do this dynamically, that is, without editing .theanorc
is it possible? Or even to choose it at runtime?
RuntimeError: ('initCnmem: cnmemInit call failed! Reason=CNMEM_STATUS_OUT_OF_MEMORY. numdev=1\n', 'You asked to force this device and it failed. No fallback to the cpu or other gpu device.')
. This was after the first import statement, couldn't even get to setting the gpu. – Artillery