If the code isn’t raising an error and you’ve pushed the data as well as the model to the GPU, it’ll be used.
You might face another bottleneck, so that the GPU utilization is low and you would mostly see a 0% util. in nvidia-smi.
To check for a data loading bottleneck, you could remove the data loading and use random tensors created on the GPU, which should show a higher GPU util.