Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NANOVDB_USE_SYNC_CUDA_MALLOC define to force sync CUDA malloc #1799

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 25, 2024

  1. Add NANOVDB_USE_SYNC_CUDA_MALLOC define to force sync CUDA malloc

    In virtualized environments that slice up the GPU and share it
    between instances as vGPU's, GPU unified memory is usually disabled
    out of security considerations. Asynchronous CUDA malloc/free
    depends on GPU unified memory, so before, it was not possible to
    deploy and run NanoVDB code in such environments.
    
    This commit adds macros CUDA_MALLOC and CUDA_FREE and replaces all
    CUDA alloc/free calls with these macros. CUDA_MALLOC and CUDA_FREE
    expand to asynchronous CUDA malloc & free if the following two
    conditions are met:
    
      - CUDA version needs to be >= 11.2 as this is the first version
        that supports cudaMallocAsync/cudaMallocFree
      - NANOVDB_USE_SYNC_CUDA_MALLOC needs to undefined
    
    In all other cases, CUDA_MALLOC and CUDA_FREE expand to synchronous
    cudaMalloc/cudaFree.
    
    Since NanoVDB is distributed as header-only, setting the
    NANOVDB_USE_SYNC_CUDA_MALLOC flag should be handled by the project's
    build system itself.
    
    Signed-off-by: Wouter Bijlsma <[email protected]>
    w0utert committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    0f46c21 View commit details
    Browse the repository at this point in the history
  2. Fix typo in comment

    Signed-off-by: Wouter Bijlsma <[email protected]>
    w0utert committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    4c01b38 View commit details
    Browse the repository at this point in the history