-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathp40_gpu.html
More file actions
245 lines (208 loc) · 7.62 KB
/
p40_gpu.html
File metadata and controls
245 lines (208 loc) · 7.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<html>
<head>
<title>P40 Cluster</title>
<!--<meta http-equiv="refresh" content="1">-->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="static/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="static/js/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="static/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="static/css/github-markdown.min.css">
<style type="text/css">
body {
padding-bottom: 200px;
}
.process.label {
font-size: 80%;
font-weight: normal;
color: #e3e9ee;
}
.th-machine {
width: 198px;
}
.th-machine h2 {
margin: -8px 15px 0 0;
display: inline;
}
.th-machine small {
font-size: 90%;
color: #777;
font-weight: 400;
}
.title-table th {
border-top-width: 3px !important;
}
.title-table {
margin-top: 40px;
}
.th-id {
width: 18px;
}
.th-name {
width: 180px;
}
.th-mem {
width: 130px;
}
.th-usage {
width: 130px;
}
td .progress {
margin: 0;
}
td .progress.progress-success {
background-color: #deedde;
}
td .progress.progress-warning {
background-color: #f8eed3;
}
td .progress.progress-danger {
background-color: #f3dedd;
}
.process .user {
font-weight: bold;
color: #fff;
}
h1 small, h2 small {
font-size: 50%;
}
h2 small .label-danger {
font-size: 80%;
}
.btn-process {
font-size: 10px;
padding: 1px 3px 0px;
vertical-align: top;
}
.popover-content {
padding: 1px 5px 4px;
}
</style>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"><span
class="sr-only">Toggle navigation</span><span
class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
<a class="navbar-brand" href="/">Home</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% if cur_user != None%}
<li>
<a href="/system">System</a>
</li>
{% end %}
<li>
<a href="/permission">User Permission</a>
</li>
<li>
<a href="/cs280_permission">CS280 User Permission</a>
</li>
<li>
<a href="https://github.com/piaozhx/DockerMonitor/issues" target="_blank">Discuss</a>
</li>
<li>
<a href="http://10.19.124.11:8898" target="_blank">Doc</a>
</li>
<li>
<a href="/gpu">GPU Status</a>
</li>
<li class="active">
<a href="/p40_gpu">P40 GPU Status</a>
</li>
<li>
<a href="/gpu">Courses GPU Status</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
{% if cur_user == None%}
<li>
<a href="/login">Login</a>
</li>
{% else %}
<li>
<a href="/user">{{ cur_user }}</a>
</li>
{% end %}
</ul>
</div>
</nav>
<div class="container">
<div class="row clearfix">
<h2>P40 Cluster (10.15.22.198) (node01 ~ node12)</h2>
{% for node_gpu_msg in node_gpu_msg_list %}
<h4>{% raw node_gpu_msg['hostname'] %}
<small>{% raw node_gpu_msg['query_time'] %}</small>
</h4>
<table class="table table-striped table-condensed">
<tr>
<th class="th-id">#</th>
<th class="th-name">Name</th>
<th class="th-mem">Memory</th>
<th class="th-usage">GPU</th>
<th class="th-processes"><span class="hidden-xs">Processes <span class="label label-default">pid@user (RAM)</span></span></th>
</tr>
{% for gpu_msg in node_gpu_msg['gpus'] %}
<tr>
<td>{%raw gpu_msg['index'] %}</td>
<td>
<span class="hidden-xs">{% raw gpu_msg['name'] %}</span>
</td>
<td>
<div class="progress progress-success" data-toggle="tooltip" data-placement="top"
title="{%raw str(gpu_msg['memory.used']) + '/' + str(gpu_msg['memory.total']) %}">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="11" aria-valuemin="0" aria-valuemax="100"
style="width: {% raw int(gpu_msg['memory.used'] / gpu_msg['memory.total'] * 100) %}%">
{% raw int(gpu_msg['memory.used'] / gpu_msg['memory.total'] * 100) %}%
</div>
</div>
</td>
<td>
<div class="progress progress-danger" data-toggle="tooltip" data-placement="top" title="{% raw gpu_msg['temperature.gpu'] %} °C">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="92" aria-valuemin="0" aria-valuemax="100"
style="width: {% raw gpu_msg['utilization.gpu']%}%">
{% raw gpu_msg['utilization.gpu']%}%
</div>
</div>
</td>
<td>
{% for process in gpu_msg['processes'] %}
<span class="hidden-xs process-content">
<span class="process label label-primary" data-toggle="tooltip" data-placement="top" data-html="true"
title="{% raw '(%s) Mem: %d Mib <br/> 运行时间: %s'%(process['command'], process['gpu_memory_usage'], process['runtime']) %}">{%raw process['pid'] %}@<span
class="user">{%raw process['username'] %}</span> ({% raw int(process['gpu_memory_usage'] / gpu_msg['memory.total'] * 100)%}%)</span>
</span>
<span class="visible-xs-inline">
<a type="button" tabindex="0" role="button" class="btn btn-default btn-xs btn-process"><i
class="glyphicon glyphicon-triangle-bottom"></i></a>
</span>
{% end %}
</td>
</tr>
{% end%}
</table>
{% end %}
</div>
</div>
<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('.btn-process').popover({
placement: 'top',
container: 'body',
html: true,
//selector: '[rel="popover"]', //Sepcify the selector here
content: function () {
var data = $(this).parent().parent().find(".process-content").html();
if (data.trim() == "") data = "<small>No process</small>"
return data;
},
trigger: "focus"
});
})
</script>
</body>
</html>