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
orangecat
ollama
Commits
f32ea81b
"docs/ZH_CN/vscode:/vscode.git/clone" did not exist on "38d11b829f79e6dce149e95dfd89d5ada2ee197a"
Unverified
Commit
f32ea81b
authored
Jan 20, 2024
by
Jeffrey Morgan
Committed by
GitHub
Jan 20, 2024
Browse files
increase minimum overhead to 1024MiB (#2114)
parent
4c54f0dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
gpu/gpu.go
gpu/gpu.go
+3
-3
No files found.
gpu/gpu.go
View file @
f32ea81b
...
...
@@ -191,11 +191,11 @@ func getCPUMem() (memInfo, error) {
func
CheckVRAM
()
(
int64
,
error
)
{
gpuInfo
:=
GetGPUInfo
()
if
gpuInfo
.
FreeMemory
>
0
&&
(
gpuInfo
.
Library
==
"cuda"
||
gpuInfo
.
Library
==
"rocm"
)
{
// leave 10% or
512
MiB of VRAM free per GPU to handle unaccounted for overhead
// leave 10% or
1024
MiB of VRAM free per GPU to handle unaccounted for overhead
overhead
:=
gpuInfo
.
FreeMemory
/
10
gpus
:=
uint64
(
gpuInfo
.
DeviceCount
)
if
overhead
<
gpus
*
512
*
1024
*
1024
{
overhead
=
gpus
*
512
*
1024
*
1024
if
overhead
<
gpus
*
1024
*
1024
*
1024
{
overhead
=
gpus
*
1024
*
1024
*
1024
}
return
int64
(
gpuInfo
.
FreeMemory
-
overhead
),
nil
}
...
...
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