Why program still use CPU to run my GPU libtorch program?

I try to run my project with GPU Version in release mode, but my task manager shows that it seems to run on CPU? But this occasion has not occurred in Debug version.

From the above picture, we can see that GPU utilization is 0, and most of the tensors appear to be deployed in memory instead of the GPU memory.

I don’t know any details about your workload but note that the CPU will still be used even if the actual kernel execution is done on the GPU. In this case the CPU would still be at least responsible for the kernel launches and usually also for the data loading and processing.

To properly see the GPU utilization in the Windows task manager you would have to select the “compute” tab (in case that’s not already done) as the default view apparently does not show the utilized compute resources (we’ve had similar discussions about it e.g. here).

1 Like

Thanks for your reply!
I have checked task manager(change to Cuda and compute), and it still does not show any difference(that means Cuda and compute are zero :frowning: ). But I inspect nvidia-smi which proves my module does be deployed in GPU.
Last, I want to know when can I use FP16 in libtorch?