Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
4059a297
Unverified
Commit
4059a297
authored
Apr 01, 2025
by
湛露先生
Committed by
GitHub
Mar 31, 2025
Browse files
discover: /proc/cpuinfo file open and close. (#9950)
Signed-off-by:
zhanluxianshen
<
zhanluxianshen@163.com
>
parent
66b25392
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
discover/gpu_linux.go
discover/gpu_linux.go
+2
-3
No files found.
discover/gpu_linux.go
View file @
4059a297
...
...
@@ -111,6 +111,7 @@ func GetCPUDetails() ([]CPU, error) {
if
err
!=
nil
{
return
nil
,
err
}
defer
file
.
Close
()
return
linuxCPUDetails
(
file
)
}
...
...
@@ -168,13 +169,11 @@ func linuxCPUDetails(file io.Reader) ([]CPU, error) {
for
id
,
s
:=
range
socketByID
{
s
.
CoreCount
=
len
(
coreBySocket
[
id
])
s
.
ThreadCount
=
0
for
_
,
tc
:=
range
threadsByCoreBySocket
[
id
]
{
s
.
ThreadCount
+=
tc
}
// This only works if HT is enabled, consider a more reliable model, maybe cache size comparisons?
efficiencyCoreCount
:=
0
for
_
,
threads
:=
range
threadsByCoreBySocket
[
id
]
{
s
.
ThreadCount
+=
threads
if
threads
==
1
{
efficiencyCoreCount
++
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment