Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

[BUG]: cuproj fails on assert with README.md example/test #1573

@MartinPulec

Description

@MartinPulec

Version

25.08

On which installation method(s) does this occur?

No response

Describe the issue

cuproj fails on assert() if compiled without -DNDEBUG with the WGS_TO_UTM_TEST test of the cuproj/README.md example. But I think it the behavior reproducible always, not just in that example/test (I didn't succeed to make this run when trying; I didn't inspect the assertion, however).

Without that assert, the code gives, however, correct results.

Default CMake build type seems to be set to Release, which disables asserts. So this occurs just when using the Debug build type (or not defining NDEBUG in general).

Minimum reproducible example

git clone -b branch-25.08 https://github.com/rapidsai/cuspatial.git
mkdir cuspatial/cpp/cuproj/build && cd cuspatial/cpp/cuproj/build
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
cmake --build .
export PROJ_LIB=$PWD/_deps/proj-build/data # setting path for proj.db
ctest -R WGS_TO_UTM_TEST --output-on-failure

Relevant log output

/tmp/cuspatial/cpp/cuproj/include/cuproj/operation/clamp_angular_coordinates.cuh:131: const T &cuproj::clamp_angular_coordinates<Coordinate, T>::clamp(const T &, const T &, const T &) const [with Coordinate = cuspatial::vec_2d<float>; T = float]: block: [0,0,0], thread: [0,0,0] Assertion `!(low < high)&& "Invalid clamp range"` failed.
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  CUDA free failed: cudaErrorAssert: device-side assert triggered

Environment details

- bare metal
- print_env.sh:

<details><summary>Click here to see environment details</summary><pre>

     **git***
     commit 2c50bcbe4bb68cc0a7d1b730eb3c2e4ccfd88914 (HEAD -> branch-25.08, origin/branch-25.08, origin/HEAD)
     Merge: 63bdcbab c0f92e5b
     Author: gpuCI <[email protected]>
     Date:   Tue May 6 17:04:35 2025 -0400

     Merge pull request #1566 from rapidsai/branch-25.06

     Forward-merge branch-25.06 into branch-25.08
     **git submodules***

     ***OS Information***
     PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
     NAME="Debian GNU/Linux"
     VERSION_ID="12"
     VERSION="12 (bookworm)"
     VERSION_CODENAME=bookworm
     ID=debian
     HOME_URL="https://www.debian.org/"
     SUPPORT_URL="https://www.debian.org/support"
     BUG_REPORT_URL="https://bugs.debian.org/"
     Linux hd15 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux

     ***GPU Information***
     Mon Jul 21 08:26:13 2025
     +-----------------------------------------------------------------------------------------+
     | NVIDIA-SMI 575.57.08              Driver Version: 575.57.08      CUDA Version: 12.9     |
     |-----------------------------------------+------------------------+----------------------+
     | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
     | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
     |                                         |                        |               MIG M. |
     |=========================================+========================+======================|
     |   0  NVIDIA GeForce RTX 4080        Off |   00000000:01:00.0 Off |                  N/A |
     |  0%   53C    P0             30W /  340W |       0MiB /  16376MiB |      2%      Default |
     |                                         |                        |                  N/A |
     +-----------------------------------------+------------------------+----------------------+

     +-----------------------------------------------------------------------------------------+
     | Processes:                                                                              |
     |  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
     |        ID   ID                                                               Usage      |
     |=========================================================================================|
     |  No running processes found                                                             |
     +-----------------------------------------------------------------------------------------+

     ***CPU***
     Architecture:                         x86_64
     CPU op-mode(s):                       32-bit, 64-bit
     Address sizes:                        48 bits physical, 48 bits virtual
     Byte Order:                           Little Endian
     CPU(s):                               24
     On-line CPU(s) list:                  0-23
     Vendor ID:                            AuthenticAMD
     Model name:                           AMD Ryzen 9 7900X 12-Core Processor
     CPU family:                           25
     Model:                                97
     Thread(s) per core:                   2
     Core(s) per socket:                   12
     Socket(s):                            1
     Stepping:                             2
     Frequency boost:                      enabled
     CPU(s) scaling MHz:                   55%
     CPU max MHz:                          5732.7139
     CPU min MHz:                          3000.0000
     BogoMIPS:                             9400.19
     Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d amd_lbr_pmc_freeze
     Virtualization:                       AMD-V
     L1d cache:                            384 KiB (12 instances)
     L1i cache:                            384 KiB (12 instances)
     L2 cache:                             12 MiB (12 instances)
     L3 cache:                             64 MiB (2 instances)
     NUMA node(s):                         1
     NUMA node0 CPU(s):                    0-23
     Vulnerability Gather data sampling:   Not affected
     Vulnerability Itlb multihit:          Not affected
     Vulnerability L1tf:                   Not affected
     Vulnerability Mds:                    Not affected
     Vulnerability Meltdown:               Not affected
     Vulnerability Mmio stale data:        Not affected
     Vulnerability Reg file data sampling: Not affected
     Vulnerability Retbleed:               Not affected
     Vulnerability Spec rstack overflow:   Mitigation; safe RET, no microcode
     Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
     Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
     Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
     Vulnerability Srbds:                  Not affected
     Vulnerability Tsx async abort:        Not affected

     ***CMake***
     /usr/local/bin/cmake
     cmake version 4.1.0-rc1

     CMake suite maintained and supported by Kitware (kitware.com/cmake).

     ***g++***
     /usr/bin/g++
     g++ (Debian 12.2.0-14) 12.2.0
     Copyright (C) 2022 Free Software Foundation, Inc.
     This is free software; see the source for copying conditions.  There is NO
     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

     ***nvcc***
     /usr/local/cuda/bin/nvcc
     nvcc: NVIDIA (R) Cuda compiler driver
     Copyright (c) 2005-2025 NVIDIA Corporation
     Built on Wed_Apr__9_19:24:57_PDT_2025
     Cuda compilation tools, release 12.9, V12.9.41
     Build cuda_12.9.r12.9/compiler.35813241_0

     ***Python***

     ***Environment Variables***
     PATH                            : /home/xpulec/.local/bin:/home/xpulec/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/usr/loca
     LD_LIBRARY_PATH                 : /usr/local/cuda/lib64:/home/xpulec/lib
     NUMBAPRO_NVVM                   :
     NUMBAPRO_LIBDEVICE              :
     CONDA_PREFIX                    :
     PYTHON_PATH                     :

     conda not found
     ***pip packages***
     /usr/bin/pip
     Package               Version
     --------------------- ------------
     aiofiles              23.1.0
     anyio                 3.6.2
     argcomplete           2.0.0
     asgiref               3.6.0
     attrs                 22.2.0
     Babel                 2.10.3
     beautifulsoup4        4.11.2
     beniget               0.4.1
     blinker               1.5
     boto3                 1.26.27
     botocore              1.29.27
     Brlapi                0.8.4
     Brotli                1.0.9
     certifi               2022.9.24
     chardet               5.1.0
     charset-normalizer    3.0.1
     click                 8.1.3
     colorama              0.4.6
     crit                  3.17.1
     cryptography          38.0.4
     cupshelpers           1.0
     dbus-python           1.3.2
     decorator             5.1.1
     distro                1.8.0
     distro-info           1.5+deb12u1
     docker                5.0.3
     docker-compose        1.29.2
     dockerpty             0.4.1
     docopt                0.6.2
     docstring-to-markdown 0.11
     fastapi               0.92.0
     gast                  0.5.2
     GDAL                  3.6.2
     ghp-import            2.1.0
     h11                   0.14.0
     html5lib              1.1
     httplib2              0.20.4
     idna                  3.3
     iniconfig             1.1.1
     itsdangerous          2.1.2
     jedi                  0.18.2
     Jinja2                3.1.2
     jmespath              1.0.1
     joblib                1.2.0
     jsonpointer           2.3
     jsonschema            4.10.3
     lazr.restfulclient    0.14.5
     lazr.uri              1.0.6
     libevdev              0.5
     livereload            2.6.3
     louis                 3.24.0
     lunr                  0.6.2
     lxml                  4.9.2
     Mako                  1.2.4.dev0
     Markdown              3.4.1
     MarkupSafe            2.1.2
     mergedeep             1.3.4
     mkdocs                1.4.2
     more-itertools        8.10.0
     mutagen               1.46.0
     nltk                  3.8
     numpy                 1.24.2
     oauthlib              3.2.2
     olefile               0.46
     packaging             23.0
     parso                 0.8.3
     Pillow                9.4.0
     pip                   23.0.1
     pipx                  1.1.0
     pluggy                1.0.0+repack
     ply                   3.11
     protobuf              4.21.12
     psutil                5.9.4
     py                    1.11.0
     pycairo               1.20.1
     pycryptodomex         3.11.0
     pycups                2.0.1
     pycurl                7.45.2
     pydantic              1.10.4
     Pygments              2.14.0
     PyGObject             3.42.2
     pyinotify             0.9.6
     PyJWT                 2.6.0
     pyparsing             3.0.9
     pyrsistent            0.18.1
     PySimpleSOAP          1.16.2
     pysmbc                1.0.23
     pytest                7.2.1
     python-apt            2.6.0
     python-dateutil       2.8.2
     python-debian         0.1.49
     python-debianbts      4.0.1
     python-dotenv         0.21.0
     python-lsp-jsonrpc    1.0.0
     python-lsp-server     1.7.1
     python-multipart      0.0.5
     pythran               0.11.0
     pytz                  2022.7.1
     pyudev                0.24.0
     pyxattr               0.8.1
     pyxdg                 0.28
     PyYAML                6.0
     pyyaml_env_tag        0.1
     regex                 2022.10.31
     reportbug             12.0.0
     requests              2.28.1
     rfc3987               1.3.8
     s3transfer            0.6.0
     scipy                 1.10.1
     setuptools            66.1.1
     simplejson            3.18.3
     six                   1.16.0
     sniffio               1.2.0
     soupsieve             2.3.2
     starlette             0.26.1
     texttable             1.6.7
     tornado               6.2
     tqdm                  4.64.1
     typing_extensions     4.4.0
     ujson                 5.7.0
     uritemplate           4.1.1
     urllib3               1.26.12
     userpath              1.8.0
     uvicorn               0.17.6
     wadllib               1.3.6
     watchdog              2.2.1
     webcolors             1.11.1
     webencodings          0.5.1
     websocket-client      1.2.3
     websockets            10.4
     wheel                 0.38.4
     wsproto               1.2.0
     xdg                   5
     yt-dlp                2023.3.4

</pre></details>

Other/Misc.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalIssues filed by people outside the teamNeeds TriageNeed team to review and classifybugSomething isn't workinglibcuprojRelates to the libcuproj C++ library

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions