Use GPU integrated on laptop for deep learning with pytorch

I want to train my deep learning model on my laptop with GPU-integrated configuration:

  • AMD Radeon™ Graphics
  • Display memory: 512MB
  • Shared memory: 3770MB
    I am using lightning-hydra-template for my project. Can I train on my laptop? If if can then how can I do that? Thank you so much!

if you are using linux, install pytorch with rocm support
if you are on windows which I assume you are, you need to install torch_directml alongside pytorch and get your torch device from there and use it.