Open pjavia-iterativescopes opened 5 years ago
I found the answer. It would be great if it is added into documentation.
with core.DeviceScope(core.DeviceOption(caffe2_pb2.CUDA, 0)):
# Create model here
workspace.RunNetOnce(model.net.param_init_net)
workspace.CreateNet(model.net)
GPU test passed. However, when I run code no PID is shown on nvidia-smi. Is there other way to check whether the code is running on GPU? Or is there some more lines of code I need to add so that caffe2 detects GPUs and uses it?