Skip to content

GH-46165: [C++] Add cuda option to Meson configuration#46166

Open
WillAyd wants to merge 5 commits into
apache:mainfrom
WillAyd:meson-add-cuda
Open

GH-46165: [C++] Add cuda option to Meson configuration#46166
WillAyd wants to merge 5 commits into
apache:mainfrom
WillAyd:meson-add-cuda

Conversation

@WillAyd

@WillAyd WillAyd commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

Rationale for this change

This continues building out support for Meson as a build system gnerator

What changes are included in this PR?

Adds a cuda option that pulls in the gpu directory

Are these changes tested?

No

Are there any user-facing changes?

No

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #46165 has been automatically assigned in GitHub to PR creator.

@WillAyd

WillAyd commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

I am unable to fully test this locally as I do not have a CUDA-enabled device. I can configure the project and compile, but at link time I get errors like:

/usr/bin/ld: src/arrow/gpu/libarrow-cuda.so.p/cuda_context.cc.o: in function `arrow::cuda::CudaDevice::AllocateHostBuffer(long)':
/home/willayd/clones/arrow/cpp/builddir/../src/arrow/gpu/cuda_context.cc:266:(.text+0xa88): undefined reference to `cuMemHostAlloc'
/usr/bin/ld: src/arrow/gpu/libarrow-cuda.so.p/cuda_context.cc.o: in function `arrow::cuda::CudaDevice::MakeStream(unsigned int)::{lambda(void*)#1}::operator()(void*) const':
/home/willayd/clones/arrow/cpp/builddir/../src/arrow/gpu/cuda_context.cc:286:(.text+0xc29): undefined reference to `cuStreamDestroy_v2'
/usr/bin/ld: src/arrow/gpu/libarrow-cuda.so.p/cuda_context.cc.o: in function `arrow::cuda::CudaDevice::MakeStream(unsigned int)':
/home/willayd/clones/arrow/cpp/builddir/../src/arrow/gpu/cuda_context.cc:280:(.text+0xf1f): undefined reference to `cuStreamCreate'

I believe those missing symbols are from drivers that I cannot install, although my familiarity with building CUDA applications is admittedly low

@kou

kou commented Apr 23, 2025

Copy link
Copy Markdown
Member

We can build cpp/src/arrow/gpu/ without CUDA-enabled device. For example, our deb packages do it: https://github.com/ursacomputing/crossbow/actions/runs/14590422628/job/40924210051#step:8:8349

-- Installing: /build/apache-arrow-20.0.0.dev326/debian/tmp/usr/lib/x86_64-linux-gnu/libarrow_cuda.so.2000.0.0

FYI: We can use nvidia-cuda-toolkit on Debian for it:

apt install -y -V ${quiet} nvidia-cuda-toolkit; \

@WillAyd

WillAyd commented Apr 23, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: 5b4a4be4ff81439f3a017aae5583dd6303b76b10

Submitted crossbow builds: ursacomputing/crossbow @ actions-c4ce1f69f0

Task Status
test-conda-cpp-meson GitHub Actions

@WillAyd

WillAyd commented Apr 23, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: e21c24fbe237c1e6bf123f1e69cf6ce817e57210

Submitted crossbow builds: ursacomputing/crossbow @ actions-13cedcf855

Task Status
test-conda-cpp-meson GitHub Actions

@WillAyd WillAyd added the CI: Extra Run extra CI label Jul 19, 2025
@WillAyd WillAyd force-pushed the meson-add-cuda branch 5 times, most recently from cef0cfb to 1ab3aa3 Compare July 21, 2025 20:02
@WillAyd WillAyd force-pushed the meson-add-cuda branch 4 times, most recently from 42a767f to 919fdd1 Compare July 29, 2025 05:59
@WillAyd

WillAyd commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

It looks like detecting CUDA installed via Python may need the upcoming Meson 1.9 release to build correctly. We could also try to install on the system instead for current Meson versions, although I think waiting for 1.9 is easiest (should be released soonish)

@WillAyd WillAyd force-pushed the meson-add-cuda branch 4 times, most recently from b33f7bc to f083c0c Compare September 10, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants