Skip to content

Commit

Permalink
Log CUDA kernel vs. runtime versions
Browse files Browse the repository at this point in the history
The goal here is to hopefully provide a troubleshooting hint, that helps
users resolve CUDA version compatibility issues.
  • Loading branch information
jart committed Nov 14, 2024
1 parent 8413a21 commit 9bb262b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion llama.cpp/ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,22 @@ void ggml_abort(const char * file, int line, const char * fmt, ...) {

GGML_CALL bool ggml_cuda_link(const struct ggml_backend_api *backend_api) {
g_backend = backend_api;
if (!FLAG_log_disable)

if (!FLAG_log_disable) {
int kernelVersion = 0;
cudaDriverGetVersion(&kernelVersion);
fprintf(stderr, "%s: CUDA kernel version %d.%d\n", __func__,
kernelVersion / 1000, (kernelVersion % 1000) / 10);

int runtimeVersion = 0;
cudaRuntimeGetVersion(&runtimeVersion);
fprintf(stderr, "%s: CUDA runtime version is %d.%d%s\n", __func__,
runtimeVersion / 1000, (runtimeVersion % 1000) / 10,
runtimeVersion > kernelVersion ? " (!!!)" : "");

fprintf(stderr, "%s: welcome to " GGML_CUDA_NAME " SDK with " BLAS_NAME "\n", __func__);
}

#ifdef __HIP_PLATFORM_AMD__
// cargo culting workaround below
#ifndef GGML_USE_TINYBLAS
Expand Down

0 comments on commit 9bb262b

Please sign in to comment.