fix(cuda): include <float.h> for FLT_MAX (build fails on CUDA 12.8 / Blackwell) - #666
Open
joelteply wants to merge 1 commit into
Open
fix(cuda): include <float.h> for FLT_MAX (build fails on CUDA 12.8 / Blackwell)#666joelteply wants to merge 1 commit into
joelteply wants to merge 1 commit into
Conversation
…ackwell) ds4_cuda.cu uses FLT_MAX (e.g. lines 23467, 23821, 24024) but only includes <math.h> and <limits.h>. On CUDA 12.8's nvcc (Blackwell / sm_120 toolchain) <float.h> is not pulled in transitively, so the CUDA build fails: ds4_cuda.cu(23467): error: identifier "FLT_MAX" is undefined Add the explicit <float.h> include. No behavior change; builds clean on older toolchains that already had it transitively.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building the CUDA backend with a recent nvcc (tested: CUDA 12.8,
nvidia/cuda:12.8.0-devel-ubuntu24.04, RTX 5090 /sm_120) fails:ds4_cuda.cuusesFLT_MAXbut only includes<math.h>and<limits.h>.FLT_MAXlives in<float.h>, which older CUDA toolchains happened to pull in transitively but 12.8 does not.Fix
Add the explicit
#include <float.h>. One line, no behavior change; still builds on toolchains that had it transitively.Repro
Fails before this change, builds clean after (all of
ds4/ds4-server/ds4-bench/ds4-eval/ds4-agent).Minor related note for anyone building in a GPU-less environment (CI,
docker build):make cuda-genericsetsCUDA_ARCH=native, which needs a GPU present to detect — off-GPU it falls back to a default arch and later fails on__dp4aetc. Usemake cuda CUDA_ARCH=sm_120(explicit) there. Happy to send a small containerized-build Dockerfile as a follow-up if useful.Thanks for ds4 — the SSD-streaming expert cache is excellent work.