Check who is using the graphics card under linux

Generally, the command used to check the usage of the graphics card is

nvidia-smi

But this can only output the occupation and process of the graphics card, and you can’t see who is using it.
The information is as follows
insert image description here
, but you can use the above PID information to check who called the corresponding process.
The command is:

ps -f -p 4417

Among them, 4417 is one of the PIDs in the above figure. The
output is as follows
insert image description here
. The UID corresponds to the user command.
The PID is the process number we input.
PPID is the parent process number.
STIME is the start time of the process.
TIME is how long the process has been running.
CMD is the executed command. Such as python script

Guess you like

Origin blog.csdn.net/JingpengSun/article/details/132251080