我得到function travelTime(firstTime, secondTime){
let getDate = (string) => new Date(0, 0,0, string.split(':')[0], string.split(':')[1]);
let different = (getDate(secondTime) - getDate(firstTime));
let hours = Math.floor((different % 86400000) / 3600000);
let minutes = Math.round(((different % 86400000) % 3600000) / 60000);
let result = hours + ':' + minutes;
return result;
}
const els = document.querySelectorAll('.trainShedule-timeTravel');
Array.from(els).forEach(el => {
el.innerText = travelTime(el.dataset.departureTime, el.dataset.arrivalTime);
});
得到nvidia-smi
就是这样
Memory-Usage
这个$nvidia-smi -i 0,1
Wed Mar 4 16:20:07 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.113 Driver Version: 418.113 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... Off | 00000000:18:00.0 Off | N/A |
| 27% 37C P8 1W / 250W | 10789MiB / 10989MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... Off | 00000000:3B:00.0 Off | N/A |
| 41% 50C P2 67W / 250W | 10893MiB / 10989MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 231853 C tensorflow_model_server 10779MiB |
| 1 120908 C python 10883MiB |
+-----------------------------------------------------------------------------+
是99%,但是
当我得到Memory-Usage
这样的
nvidia-smi dmon
此$nvidia-smi dmon -i 0,1
# gpu pwr gtemp mtemp sm mem enc dec mclk pclk
# Idx W C C % % % % MHz MHz
0 1 37 - 0 0 0 0 405 300
1 67 50 - 0 0 0 0 6800 1350
0 1 37 - 0 0 0 0 405 300
1 67 50 - 0 0 0 0 6800 1350
0 1 37 - 0 0 0 0 405 300
1 67 50 - 0 0 0 0 6800 1350
的值为0%,有时为0〜3%。
为什么会有这样的区别?
答案 0 :(得分:1)
Memory-Usage
中的 nvidia-smi
是内存的用法。
mem%
中的 nvidia-smi dmon
是内存的利用率。
Memory-Usage = used memory / total memory.
Utilization = time over the past sample period / global (device) memory was being read or written * 100%