Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
a155500b
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a155500b
编写于
4月 24, 2021
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GPU temperature not shown in webview #1849
上级
2baf73ff
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
1 deletion
+47
-1
glances/outputs/static/js/components/plugin-gpu/controller.js
...ces/outputs/static/js/components/plugin-gpu/controller.js
+4
-1
glances/outputs/static/js/components/plugin-gpu/view.html
glances/outputs/static/js/components/plugin-gpu/view.html
+11
-0
glances/outputs/static/public/glances.js
glances/outputs/static/public/glances.js
+0
-0
glances/outputs/static/public/glances.map.js
glances/outputs/static/public/glances.map.js
+0
-0
glances/plugins/glances_gpu.py
glances/plugins/glances_gpu.py
+32
-0
未找到文件。
glances/outputs/static/js/components/plugin-gpu/controller.js
浏览文件 @
a155500b
...
...
@@ -27,7 +27,8 @@ export default function GlancesPluginGpuController($scope, GlancesStats, ARGUMEN
vm
.
name
=
"
GPU
"
;
vm
.
mean
=
{
proc
:
null
,
mem
:
null
mem
:
null
,
temperature
:
null
};
var
sameName
=
true
;
...
...
@@ -38,6 +39,7 @@ export default function GlancesPluginGpuController($scope, GlancesStats, ARGUMEN
vm
.
mean
.
proc
+=
gpu
.
proc
;
vm
.
mean
.
mem
+=
gpu
.
mem
;
vm
.
mean
.
temperature
+=
gpu
.
temperature
;
vm
.
gpus
.
push
(
gpu
);
}
...
...
@@ -50,6 +52,7 @@ export default function GlancesPluginGpuController($scope, GlancesStats, ARGUMEN
vm
.
mean
.
proc
=
vm
.
mean
.
proc
/
stats
.
length
;
vm
.
mean
.
mem
=
vm
.
mean
.
mem
/
stats
.
length
;
vm
.
mean
.
temperature
=
vm
.
mean
.
temperature
/
stats
.
length
;
}
vm
.
getDecoration
=
function
(
gpuId
,
value
)
{
...
...
glances/outputs/static/js/components/plugin-gpu/view.html
浏览文件 @
a155500b
...
...
@@ -17,6 +17,14 @@
</div>
<div
class=
"table-cell"
ng-if=
"vm.mean.mem == null"
>
N/A
</div>
</div>
<div
class=
"table-row"
ng-if=
"arguments.meangpu || vm.gpus.length === 1"
>
<div
class=
"table-cell text-left"
>
temperature::
</div>
<div
class=
"table-cell"
ng-class=
"vm.getMeanDecoration('temperature')"
ng-if=
"vm.mean.temperature != null"
>
{{ vm.mean.temperature | number
:
0 }}%
</div>
<div
class=
"table-cell"
ng-if=
"vm.mean.temperature == null"
>
N/A
</div>
</div>
<div
class=
"table-row"
ng-if=
"!arguments.meangpu && vm.gpus.length > 1"
ng-repeat=
"gpu in vm.gpus"
>
<div
class=
"table-cell text-left"
>
{{ gpu.gpu_id }}:
...
...
@@ -25,6 +33,9 @@
mem:
<span
ng-class=
"vm.getDecoration(gpu.gpu_id, 'mem')"
ng-if=
"gpu.mem != null"
>
{{ gpu.mem | number : 0 }}%
</span>
<span
ng-if=
"gpu.mem == null"
>
N/A
</span>
temp:
<span
ng-class=
"vm.getDecoration(gpu.gpu_id, 'temperature')"
ng-if=
"gpu.temperature != null"
>
{{ gpu.temperature | number : 0 }}C
</span>
<span
ng-if=
"gpu.temperature == null"
>
N/A
</span>
</div>
</div>
</div>
...
...
glances/outputs/static/public/glances.js
浏览文件 @
a155500b
此差异由.gitattributes 抑制。
glances/outputs/static/public/glances.map.js
浏览文件 @
a155500b
此差异由.gitattributes 抑制。
glances/plugins/glances_gpu.py
浏览文件 @
a155500b
...
...
@@ -88,6 +88,38 @@ class Plugin(GlancesPlugin):
stats
=
self
.
get_init_value
()
if
not
self
.
nvml_ready
:
# !!!
# Uncomment to test on computer without GPU
# One GPU sample:
# self.stats = [
# {
# "key": "gpu_id",
# "gpu_id": 0,
# "name": "Fake GeForce GTX",
# "mem": 5.792331695556641,
# "proc": 4,
# "temperature": 26
# }
# ]
# Two GPU sample:
# self.stats = [
# {
# "key": "gpu_id",
# "gpu_id": 0,
# "name": "Fake GeForce GTX1",
# "mem": 5.792331695556641,
# "proc": 4,
# "temperature": 26
# },
# {
# "key": "gpu_id",
# "gpu_id": 1,
# "name": "Fake GeForce GTX2",
# "mem": 15,
# "proc": 8,
# "temperature": 65
# }
# ]
return
self
.
stats
if
self
.
input_method
==
'local'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录