0

I am using PyTorch on NVIDIA Jetson TX2 (GPU and CPU have shared memory), and have only about 2 Gb of free memory.

Specifications:

  • PyTorch v1.10.0
  • JetPack 4.6.1
  • CUDA 10.2

Whenever I try to use GPU, "torch.cuda.init()" would consume about 2Gb of memory. If I use only the CPU, the memory overhead would be only 180 Mb of memory.

I have been searching the net and found that the reason is a load of kernels. I understand that a lot of kernels are used for optimal computing, however, I can not even use my GPU due to it. Also, I think that the overwhelming majority of kernels would be never used by me.

Could you please say how to reduce the memory overhead if I am willing to sacrifice the performance as long as I could use GPU?

Would it be possible to reduce it to the CUDA bare minimum? If it is possible, how to accomplish it?

I am trying to train the relatively small model with Conv2D, Pooling, and Dense layers.

At least how to reduce the memory overhead, so I could train simple models with only Dense layers?

I also can not switch to other libraries due to other reasons.

talonmies
  • 70,661
  • 34
  • 192
  • 269
Mars
  • 1
  • 2

0 Answers0