From 3f9fe3e50ec6a8aad49bf7755fb7d9a7b8680b45 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Wed, 13 Aug 2025 15:42:16 -0700 Subject: [PATCH] cuda: leverage JIT for smaller footprint (#11635) Prior to this change our official binaries contained both JIT PTX code and the cubin binary code for our chosen compute capabilities. This change switches to only compile the PTX code and rely on JIT at runtime for generating the cubin specific to the users GPU. The cubins are cached on the users system, so they should only see a small lag on the very first model load for a given Ollama release. This also adds the first generation of Blackwell GPUs so they aren't reliant on the Hopper PTX. This change reduces the ggml-cuda.dll from 1.2G to 460M --- CMakePresets.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index ab2cfe9d6..95ec0d799 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -22,7 +22,7 @@ "name": "CUDA 12", "inherits": [ "CUDA" ], "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "50;60;61;70;75;80;86;87;89;90;90a;120", + "CMAKE_CUDA_ARCHITECTURES": "50-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;86-virtual;89-virtual;90-virtual;90a-virtual;100-virtual;120-virtual", "CMAKE_CUDA_FLAGS": "-Wno-deprecated-gpu-targets -t 2" } }, @@ -30,14 +30,14 @@ "name": "JetPack 5", "inherits": [ "CUDA" ], "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "72;87" + "CMAKE_CUDA_ARCHITECTURES": "72-virtual;87-virtual" } }, { "name": "JetPack 6", "inherits": [ "CUDA" ], "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "87" + "CMAKE_CUDA_ARCHITECTURES": "87-virtual" } }, {