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

[WIP] Windows compilation #1298

Draft
wants to merge 29 commits into
base: branch-23.08
Choose a base branch
from

Conversation

karthikeyann
Copy link
Contributor

@karthikeyann karthikeyann commented Jul 5, 2023

Description

The changes in this PR allow windows compilation to succeed for librmm and their tests to pass (some fail TBD).

Windows Setup:

  • Visual Studio 2022 - 17.6.4 (MSVC v143)
    cl.exe Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32535 for x64
  • vcpkg
  • CUDA 12.1
  • cmake-3.27.0
  • ninja v1.11.1 binary
  • miniconda

Environment Setup:

conda env create --name rmm_dev --file conda/environments/all_cuda-120_arch-x86_64.yaml
vcpkg install pthread:x64-windows
conda install -c conda-forge dlfcn-win32

Compilation:

  • Open Anaconda prompt
  • Run vcvars32.bat or vcvars64.bat file to allow msvc compilation
  • conda activate rmm_dev
  • mkdir build; cd build, mkdir ..\..\install
  • cmake .. -G "Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=..\..\install -DCMAKE_TOOLCHAIN_FILE=C:/Users/karthikeyann/Desktop/vcpkg/scripts/buildsystems/vcpkg.cmake
  • cmake --build .

Changes after cmake configure attempt:

rapids-cmake comment out compilation code in
C:\Users\karthikeyann\Desktop\rmm\build\_deps\rapids-cmake-src\rapids-cmake\test\generate_resource_spec.cmake
and update the cuda compute capability minor, major version in same file.

Renamed C:\Users\karthikeyann\Desktop\rmm\build\_deps\thrust-src\cub symlink to cub2.
msvc does not support symlink within pre-processor.
so, copied folder C:\Users\karthikeyann\Desktop\rmm\build\_deps\thrust-src\dependencies\cub\cub
to
C:\Users\karthikeyann\Desktop\rmm\build\_deps\thrust-src\cub

List of code changes:

  • RMM_EXPECTS, RMM_FAIL macro vaargs workarounds
  • add dlfcn, remove cuda-nvcc, cuda-python in dependency,
  • enable Alternative operator representations (and, or, not) using header <ciso646>
  • fix macro inside gtest macro issue
  • fix missing lambda capture
  • fix posix mkdtemp, setenv, unsetenv
  • workaround for CTAD constructor template argument missing feature
  • disable int8_t because it is not by uniform_int_distribution
  • ULL for 64 bit unsigned integer. See https://en.cppreference.com/w/cpp/language/types#Data_models
  • fix for "auto*" unsupported.
  • hack for move-only type with std::set and move constructor invoking copy constructor issue. (TBD proper fix), (bug)
  • pthread library name to pthreadVC3, cudart dll name.

All */CUDA_Async tests are skipped, as this driver version is unsupported (TBD).

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@github-actions github-actions bot added CMake conda cpp Pertains to C++ code labels Jul 5, 2023
@karthikeyann karthikeyann changed the title add dlfcn-win32, disable dl.lib, cuda-nvcc, cuda-python Windows compilation Jul 5, 2023
@karthikeyann karthikeyann changed the title Windows compilation [WIP] Windows compilation Jul 5, 2023
@jrhemstad
Copy link
Contributor

Note that RMM is structurally incompatible with Windows as a header-only library as the functionality of per_device_resource() depends on function local statics being shared across TUs. See https://stackoverflow.com/questions/62336104/are-function-local-static-objects-of-inline-functions-shared-across-shared-objec#comment110248896_62336104

RMM would need to build a DLL that holds the symbols relevant for per_device_resource.

@github-actions github-actions bot removed the conda label Jul 5, 2023
@harrism harrism added feature request New feature or request non-breaking Non-breaking change labels Jul 10, 2023
@harrism
Copy link
Member

harrism commented Jul 10, 2023

Do we have Windows CI?

@jrhemstad
Copy link
Contributor

Do we have Windows CI?

Not yet. We're working on it as CCCL needs it, but it's still many months away.

vyasr and others added 10 commits July 25, 2023 13:39
This PR migrates RMM to use `fetch_rapids.cmake` like most RAPIDS repos. This makes it easier to define a single source if the upstream branch of rapids-cmake needs to change for testing, like in rapidsai#1247.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Ray Douglass (https://github.com/raydouglass)
  - Robert Maynard (https://github.com/robertmaynard)

URL: rapidsai#1319
This PR contains the minimal set of changes to compile using Cython 3 without warnings. Future PRs can be made to take advantage of new or improved features.

The specific changes are:
- Ensuring `nogil` always comes after `except`. `except * nogil` is a compile-time error in Cython 3
- Adding `noexcept` or `except *` to any `cdef ` functions missing them. In Cython 0.29 these would default to `noexcept`, which meant that exceptions would not be properly propagated. In Cython 3.0.0, these default to `except *`, which incurs a performance penalty for reacquiring the GIL to check the exception value even for `nogil` functions. Being explicit here is important.

There are a large number of outstanding warnings due to NVIDIA/cuda-python#44. cuda-python for CUDA 12 has the necessary fix, but we will need a cuda-python 11.8.* bugfix with a backport to make those warnings go away.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Ashwin Srinath (https://github.com/shwina)
  - Lawrence Mitchell (https://github.com/wence-)
  - Ray Douglass (https://github.com/raydouglass)

URL: rapidsai#1313
This will allow us to more easily audit the quality of our docs in CI going forward.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Lawrence Mitchell (https://github.com/wence-)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: rapidsai#1316
Forward-merge branch-23.08 to branch-23.10
The latest versions `4.1` and `4.0` of `sphinxcontrib-jquery` have an issue with jQuery installed currently in sphinx. This is causing the search functionality to fail so I've pinned the version to `3.0.0`, this resolves the issue.

Authors:
   - Jake Awe (https://github.com/AyodeAwe)

Approvers:
   - https://github.com/jakirkham
   - AJ Schmidt (https://github.com/ajschmidt8)
@github-actions github-actions bot added Python Related to RMM Python API conda ci labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CMake conda cpp Pertains to C++ code feature request New feature or request non-breaking Non-breaking change Python Related to RMM Python API
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

9 participants