Effacer les filtres
Effacer les filtres

Is there a way to map the GPU number of the gpuDevice to the GPU number in Windows Task Manager?

4 vues (au cours des 30 derniers jours)
Our GPU server is shared by multiple people. I hope to avoid using the GPU that is being used by others. The main method is to check the GPU utilization rate through the task manager, because MATLAB can only check the GPU memory usage, but not the GPU computing unit usage. However, the GPU number correspondence between task manager and MATLAB gpuDevice does not seem to be fixed, and it is different every time the operating system is started.
  2 commentaires
Walter Roberson
Walter Roberson le 15 Mai 2023
Are the other people also using MATLAB, and if so would they be likely to cooperate with some minor device management steps?
If the answer to both of those is Yes, then consider using lock files together with onCleanup (to remove the lock after the session)
埃博拉酱
埃博拉酱 le 15 Mai 2023
@Walter Roberson No, they could run any other random programs on GPU, anaconda, opengl, etc.

Connectez-vous pour commenter.

Réponses (1)

Aditya Srikar
Aditya Srikar le 26 Mai 2023
Unfortunately, the correspondence between the GPU number in Task Manager and MATLAB's gpuDevice function is not always fixed. This is because the operating system assigns the GPU number based on the order in which the GPUs were initialized, and this order can vary from session to session.
To avoid using the GPU that is being used by others, you can try the following:
1. Try to coordinate with other users to avoid overlapping usage times.
2. Use a GPU monitoring tool that provides information on which processes are currently using which GPU. This will allow you to check if the GPU you want to use is currently being used by others.
3. You can use the command "nvidia-smi" in the command prompt to check the status of all GPUs and their corresponding processes. This should give you an idea of which GPUs are currently being used and by which processes. You can then select an available GPU for your MATLAB code using the "gpuDevice" function. Note that you may have to specify the index of the GPU you want to use rather than its number.
Hope this helps!

Catégories

En savoir plus sur GPU Computing dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by