pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
83.99k stars 22.64k forks source link

[Caffe2] GPU test passed. Cannot see on nvidia-smi #14508

Open pjavia-iterativescopes opened 5 years ago

pjavia-iterativescopes commented 5 years ago

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?

pjavia-iterativescopes commented 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)