From 815d86dd276ee9f7abf55e5f1bce9176d206a969 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 30 Sep 2025 18:58:03 -0500 Subject: [PATCH] Patch FAISS for missing Thrust includes (#1398) This PR patches FAISS for some missing Thrust includes. This is needed to support building with CCCL 3.1.x. RAPIDS 25.10 will still use CCCL 3.0.x but we want to make it possible to build with 3.1.x in 25.10. xref: #1329 (This backports a fix from that testing PR, which is targeting 25.12) I am upstreaming the patch here: https://github.com/facebookresearch/faiss/pull/4597 Authors: - Bradley Dice (https://github.com/bdice) - Corey J. Nolet (https://github.com/cjnolet) Approvers: - Tarang Jain (https://github.com/tarang-jain) - Divye Gala (https://github.com/divyegala) URL: https://github.com/rapidsai/cuvs/pull/1398 --- ...fix-missing-includes-for-thrust-copy.patch | 40 +++++++++++++++++++ cpp/cmake/patches/faiss_override.json | 19 ++++++--- 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 cpp/cmake/patches/faiss/fix-missing-includes-for-thrust-copy.patch diff --git a/cpp/cmake/patches/faiss/fix-missing-includes-for-thrust-copy.patch b/cpp/cmake/patches/faiss/fix-missing-includes-for-thrust-copy.patch new file mode 100644 index 0000000000..9f250b88be --- /dev/null +++ b/cpp/cmake/patches/faiss/fix-missing-includes-for-thrust-copy.patch @@ -0,0 +1,40 @@ +From 87c5331dfa6ec30fd9839ecb89af519e65f010e7 Mon Sep 17 00:00:00 2001 +From: Bradley Dice +Date: Mon, 29 Sep 2025 15:39:17 -0500 +Subject: [PATCH] Fix missing includes for thrust::copy + +--- + faiss/gpu/impl/BinaryCuvsCagra.cu | 3 +++ + faiss/gpu/impl/CuvsCagra.cu | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/faiss/gpu/impl/BinaryCuvsCagra.cu b/faiss/gpu/impl/BinaryCuvsCagra.cu +index 0ca21dc5f..b331fdc8f 100644 +--- a/faiss/gpu/impl/BinaryCuvsCagra.cu ++++ b/faiss/gpu/impl/BinaryCuvsCagra.cu +@@ -32,6 +32,9 @@ + #include + #include + ++#include ++#include ++ + namespace faiss { + namespace gpu { + +diff --git a/faiss/gpu/impl/CuvsCagra.cu b/faiss/gpu/impl/CuvsCagra.cu +index 9ac4e1c5a..755817f43 100644 +--- a/faiss/gpu/impl/CuvsCagra.cu ++++ b/faiss/gpu/impl/CuvsCagra.cu +@@ -31,6 +31,9 @@ + #include + #include + ++#include ++#include ++ + namespace faiss { + namespace gpu { + +-- +2.49.0 diff --git a/cpp/cmake/patches/faiss_override.json b/cpp/cmake/patches/faiss_override.json index f3a1aaf795..5af8bd8543 100644 --- a/cpp/cmake/patches/faiss_override.json +++ b/cpp/cmake/patches/faiss_override.json @@ -1,9 +1,16 @@ { - "packages" : { - "faiss" : { - "version": "1.12.0", - "git_url": "https://github.com/facebookresearch/faiss.git", - "git_tag": "v1.12.0" - } + "packages" : { + "faiss" : { + "version": "1.12.0", + "git_url": "https://github.com/facebookresearch/faiss.git", + "git_tag": "v1.12.0", + "patches" : [ + { + "file" : "${current_json_dir}/faiss/fix-missing-includes-for-thrust-copy.patch", + "issue" : "Fix missing Thrust includes. https://github.com/facebookresearch/faiss/pull/4597", + "fixed_in" : "" + } + ] } } +}