Hi All,
Apologies if this is a repeat question. I have searched around for some time and I am not able to find any resources.
My Situation:
I am attempting to create a CRON job which will automatically engage a Neural Network building pipeline. I have a work station with 2 GPU installed. I would like a python script to detect when either GPU is being used, and begin building the model on one that is not being used.
What I have found so far:
I have done a bit of searching, and keep coming back to people’s mention of the ‘torch.cuda.is_available()’ function, as mentioned in this link [python - How to check if pytorch is using the GPU? - Stack Overflow 3]. However, as is also mentioned in that link, this function doesn’t tell us whether or not the GPU is currently building a model. Rather, it simply tells us whether a GPU exists at all.
My Question:
Is there a way to programmatically check whether or not a PyTorch model is building on a GPU (or anything analogous) from within a Python script?
Thanks a lot and have a nice day!