/usr/bin/time 用于程序的 Nvidia GPU 利用率

/usr/bin/time 用于程序的 Nvidia GPU 利用率

是否有类似的命令行程序/usr/bin/time可以报告程序的 Nvidia GPU 利用率?

我希望获得类似以下内容的数据,其中还包括GPU time (seconds)Percent of GPU time this job got和/或功耗。我相信最接近的数据可能是nvidia-smi,但它似乎只能报告当前的 GPU 利用率,而不能汇总程序运行的情况。

$ /usr/bin/time --verbose python -c 'for i in range(int(1e8)): pass;'
    Command being timed: "python -c for i in range(int(1e8)): pass;"
    User time (seconds): 5.99
    System time (seconds): 1.66
    Percent of CPU this job got: 99%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.68
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 3189148
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 796317
    Voluntary context switches: 1
    Involuntary context switches: 302
    Swaps: 0
    File system inputs: 0
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

相关内容