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
bf7edb0d
Commit
bf7edb0d
authored
May 22, 2024
by
Michael Yang
Browse files
lint linux
parent
f38353d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
gpu/cuda_common.go
gpu/cuda_common.go
+0
-1
gpu/gpu.go
gpu/gpu.go
+3
-3
No files found.
gpu/cuda_common.go
View file @
bf7edb0d
...
@@ -18,5 +18,4 @@ func cudaGetVisibleDevicesEnv(gpuInfo []GpuInfo) (string, string) {
...
@@ -18,5 +18,4 @@ func cudaGetVisibleDevicesEnv(gpuInfo []GpuInfo) (string, string) {
ids
=
append
(
ids
,
info
.
ID
)
ids
=
append
(
ids
,
info
.
ID
)
}
}
return
"CUDA_VISIBLE_DEVICES"
,
strings
.
Join
(
ids
,
","
)
return
"CUDA_VISIBLE_DEVICES"
,
strings
.
Join
(
ids
,
","
)
}
}
gpu/gpu.go
View file @
bf7edb0d
...
@@ -187,7 +187,7 @@ func GetGPUInfo() GpuInfoList {
...
@@ -187,7 +187,7 @@ func GetGPUInfo() GpuInfoList {
resp
:=
[]
GpuInfo
{}
resp
:=
[]
GpuInfo
{}
// NVIDIA first
// NVIDIA first
for
i
:=
0
;
i
<
gpuHandles
.
deviceCount
;
i
++
{
for
i
:=
range
gpuHandles
.
deviceCount
{
// TODO once we support CPU compilation variants of GPU libraries refine this...
// TODO once we support CPU compilation variants of GPU libraries refine this...
if
cpuVariant
==
""
&&
runtime
.
GOARCH
==
"amd64"
{
if
cpuVariant
==
""
&&
runtime
.
GOARCH
==
"amd64"
{
continue
continue
...
@@ -221,8 +221,8 @@ func GetGPUInfo() GpuInfoList {
...
@@ -221,8 +221,8 @@ func GetGPUInfo() GpuInfoList {
gpuInfo
.
MinimumMemory
=
cudaMinimumMemory
gpuInfo
.
MinimumMemory
=
cudaMinimumMemory
gpuInfo
.
DependencyPath
=
depPath
gpuInfo
.
DependencyPath
=
depPath
gpuInfo
.
Name
=
C
.
GoString
(
&
memInfo
.
gpu_name
[
0
])
gpuInfo
.
Name
=
C
.
GoString
(
&
memInfo
.
gpu_name
[
0
])
gpuInfo
.
DriverMajor
=
int
(
driverMajor
)
gpuInfo
.
DriverMajor
=
driverMajor
gpuInfo
.
DriverMinor
=
int
(
driverMinor
)
gpuInfo
.
DriverMinor
=
driverMinor
// TODO potentially sort on our own algorithm instead of what the underlying GPU library does...
// TODO potentially sort on our own algorithm instead of what the underlying GPU library does...
resp
=
append
(
resp
,
gpuInfo
)
resp
=
append
(
resp
,
gpuInfo
)
...
...
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