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

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Walter Roberson
Walter Roberson il 15 Mag 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)

Accedi per commentare.

Risposte (1)

Aditya Srikar
Aditya Srikar il 26 Mag 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!

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by