Skip to content

fix compile for CUDA 13#169

Merged
simogasp merged 3 commits into
alicevision:developfrom
NathanMOlson:cuda13
Aug 29, 2025
Merged

fix compile for CUDA 13#169
simogasp merged 3 commits into
alicevision:developfrom
NathanMOlson:cuda13

Conversation

@NathanMOlson

@NathanMOlson NathanMOlson commented Aug 24, 2025

Copy link
Copy Markdown
Contributor

Description

This PR includes the changes that allow PopSift to compile on Ubuntu 24.04 with CUDA 13.0.0.

Features list

Implementation remarks

Re: 'ntvxRangePushA(a)' and ntvxRangePop(): The definition of these above #include <thrust/copy.h> wreaks havoc on the definition of these functions in nvtx3.hpp include indirectly via thrust/copy.h. I changed their name for this file, but another approach could be to move the #define blow the thrust includes. It seems like it was probably placed above the thrust includes for a reason though. The change to these macros will be overcome by #162 or #168.

In file included from /usr/local/cuda/targets/x86_64-linux/include/nvtx3/nvtx3.hpp:667,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/cub/detail/nvtx.cuh:56,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/cub/device/device_for.cuh:40,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/cuda/detail/parallel_for.h:43,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/cuda/detail/swap_ranges.h:43,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/detail/adl/swap_ranges.h:50,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/swap_ranges.inl:31,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/swap.h:147,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/cuda/detail/iter_swap.h:34,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/detail/adl/iter_swap.h:50,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/reference.h:37,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/memory.h:35,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/allocator/temporary_allocator.h:31,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/temporary_array.h:46,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/cuda/detail/internal/copy_cross_system.h:47,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/cuda/detail/copy.h:79,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/system/detail/adl/copy.h:50,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/copy.inl:29,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/detail/copy.h:72,
                 from /usr/local/cuda-13.0/targets/x86_64-linux/include/cccl/thrust/copy.h:505,
                 from /code/pypopsift/build/_deps/popsift-src/src/popsift/s_filtergrid.cu:21:
/usr/local/cuda/targets/x86_64-linux/include/nvtx3/nvToolsExt.h:1099:45: error: macro "nvtxRangePop" passed 1 arguments, but takes just 0
 1099 | NVTX_DECLSPEC int NVTX_API nvtxRangePop(void);
      |                                             ^
/code/pypopsift/build/_deps/popsift-src/src/popsift/s_filtergrid.cu:16: note: macro "nvtxRangePop" defined here
   16 | #define nvtxRangePop()
      |
In file included from /usr/local/cuda/targets/x86_64-linux/include/nvtx3/nvtxDetail/nvtxImpl.h:381,
                 from /usr/local/cuda/targets/x86_64-linux/include/nvtx3/nvToolsExt.h:1663:
/usr/local/cuda/targets/x86_64-linux/include/nvtx3/nvtxDetail/nvtxImplCore.h:163:45: error: macro "nvtxRangePop" passed 1 arguments, but takes just 0
  163 | NVTX_DECLSPEC int NVTX_API nvtxRangePop(void)
      |                                             ^
/code/pypopsift/build/_deps/popsift-src/src/popsift/s_filtergrid.cu:16: note: macro "nvtxRangePop" defined here
   16 | #define nvtxRangePop()
      |

@simogasp simogasp added scope:build cuda issues related to cuda versions labels Aug 26, 2025
@simogasp simogasp added this to the v0.10 milestone Aug 26, 2025
@simogasp
simogasp requested a review from Copilot August 26, 2025 08:38
@simogasp simogasp self-assigned this Aug 26, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes compilation issues with CUDA 13.0.0 on Ubuntu 24.04 by addressing three specific compatibility problems in the PopSift codebase.

  • Removes obsolete texture_fetch_functions.h include that is no longer available in CUDA 13
  • Migrates from deprecated thrust::identity to cuda::std::identity for Thrust >= 3.0.0
  • Resolves macro conflicts with NVTX functions by renaming local macro definitions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/popsift/s_extrema.cu Removes deprecated texture_fetch_functions.h include
src/popsift/s_filtergrid.cu Adds Thrust version compatibility and fixes NVTX macro conflicts

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/popsift/s_filtergrid.cu Outdated
Comment thread src/popsift/s_filtergrid.cu Outdated
@simogasp

Copy link
Copy Markdown
Member

Thanks for the PR!
I think we will first merge #162 and then this one

@NathanMOlson

Copy link
Copy Markdown
Contributor Author

Great! I've removed the parts that conflict with and are overcome by #162.

@simogasp
simogasp merged commit a19d394 into alicevision:develop Aug 29, 2025
5 checks passed
@simogasp

Copy link
Copy Markdown
Member

Merged! Thanks for your contribution!

@simogasp simogasp linked an issue Oct 13, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda issues related to cuda versions scope:build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] compilation error

3 participants