1、要查看进程ID为1234的进程是以哪个用户身份在运行,可以执行以下命令 ps -eo user,pid,cmd | grep 1234 2、指定显卡1 CUDA_VISIBLE_DEVICES=1 python my_script.py