Is there a way to map the GPU number of the gpuDevice to the GPU number in Windows Task Manager?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2023-5-15
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)
回答(1 个)
Aditya Srikar
2023-5-26
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!