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
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)
埃博拉酱
埃博拉酱 2023년 5월 15일
@Walter Roberson No, they could run any other random programs on GPU, anaconda, opengl, etc.

댓글을 달려면 로그인하십시오.

답변 (1개)

Aditya Srikar
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!

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by