mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 03:14:35 +00:00
cuda : disable host register by default (#6206)
This commit is contained in:
parent
f372c49ccd
commit
d0a71233fb
@ -11646,7 +11646,7 @@ GGML_CALL void ggml_backend_cuda_get_device_memory(int device, size_t * free, si
|
|||||||
}
|
}
|
||||||
|
|
||||||
GGML_CALL bool ggml_backend_cuda_register_host_buffer(void * buffer, size_t size) {
|
GGML_CALL bool ggml_backend_cuda_register_host_buffer(void * buffer, size_t size) {
|
||||||
if (getenv("GGML_CUDA_NO_PINNED") != nullptr) {
|
if (getenv("GGML_CUDA_REGISTER_HOST") == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11663,6 +11663,10 @@ GGML_CALL bool ggml_backend_cuda_register_host_buffer(void * buffer, size_t size
|
|||||||
}
|
}
|
||||||
|
|
||||||
GGML_CALL void ggml_backend_cuda_unregister_host_buffer(void * buffer) {
|
GGML_CALL void ggml_backend_cuda_unregister_host_buffer(void * buffer) {
|
||||||
|
if (getenv("GGML_CUDA_REGISTER_HOST") == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cudaError_t err = cudaHostUnregister(buffer);
|
cudaError_t err = cudaHostUnregister(buffer);
|
||||||
if (err != cudaSuccess) {
|
if (err != cudaSuccess) {
|
||||||
// clear the error
|
// clear the error
|
||||||
|
Loading…
Reference in New Issue
Block a user