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

Support Windows#79

Closed
leofang wants to merge 2 commits intorapidsai:mainfrom
leofang:win
Closed

Support Windows#79
leofang wants to merge 2 commits intorapidsai:mainfrom
leofang:win

Conversation

@leofang
Copy link
Member

@leofang leofang commented May 3, 2024

To be discussed internally...

There seems to be a complex interplay between CMake generators and CMake’s CUDA lang support…

  • VS (default):
    • CUDA lang enabled:
      • Copy the VS extension that Alex shared to %CONDA_PREFIX%\Library\extras\visual_studio_integration\MSBuildExtensions (luckily CMake explicitly suggested this path so there’s no guess work)
      • Copy cudart.lib, cudart_static.lib, and cudadevrt.lib from %CONDA_PREFIX%\Library\lib to %CONDA_PREFIX%\Library\lib\x64. It seems this is what CMake-VS assumes (at nvcc detect stage)?!
      • Switch to do dynamic linking; for static linking I hit LNK2038 error
      • Pass --config-settings=cmake.args=-Tcuda=%CONDA_PREFIX%\Library -v . to pip.
    • CUDA lang disabled (so only CXX being listed):
      • Switch to do dynamic linking; for static linking I hit LNK2038 error
      • Simplest solution, taken in this PR. (This repo does not have CUDA code so does not need CUDA lang anyway, it was an overkill.)
  • Ninja:
    • CUDA lang enabled/disabled: error (either header not found or unresolved symbols; it seems Ninja on Windows does not generate right compiler/linker flags…

@copy-pr-bot
Copy link

copy-pr-bot bot commented May 3, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gmarkall
Copy link
Contributor

I've done a little experimentation with this locally. I've tried installing the whole Conda CUDA toolkit for 12.4 (conda install cuda-toolkit) but CMake isn't finding the required components from the Conda environment:

Processing c:\work\numbadev\pynvjitlink
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pynvjitlink
  Building wheel for pynvjitlink (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pynvjitlink (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      WARNING: Use cmake.version instead of cmake.minimum-version with scikit-build-core >= 0.8
      *** scikit-build-core 0.9.4 using CMake 3.29.3 (wheel)
      *** Configuring CMake...
      2024-05-31 17:11:57,478 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None
      loading initial cache file build\cp311-cp311-win_amd64\CMakeInit.txt
      -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.22631.
      CMake Error at C:/Users/Graham Markall/AppData/Local/Temp/pip-build-env-39l0n1rh/normal/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find CUDAToolkit: Found unsuitable version "11.4.48", but
        required is at least "12.2.140" (found C:/Program Files/NVIDIA GPU
        Computing Toolkit/CUDA/v11.4/include)
      Call Stack (most recent call first):
        C:/Users/Graham Markall/AppData/Local/Temp/pip-build-env-39l0n1rh/normal/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
        C:/Users/Graham Markall/AppData/Local/Temp/pip-build-env-39l0n1rh/normal/Lib/site-packages/cmake/data/share/cmake-3.29/Modules/FindCUDAToolkit.cmake:1009 (find_package_handle_standard_args)
        CMakeLists.txt:13 (find_package)


      -- Configuring incomplete, errors occurred!

      *** CMake configuration failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pynvjitlink
Failed to build pynvjitlink
ERROR: Could not build wheels for pynvjitlink, which is required to install pyproject.toml-based projects

Maybe I need to use a system-installed toolkit?

(Not necessarily asking for help here, I can continue investigating, but just adding a note of what I've encountered so far)

@leofang
Copy link
Member Author

leofang commented May 31, 2024

Make sure you install everything from conda-forge. I think the nvidia channel is not aligned until CUDA 12.5. I developed all Windows stuff using CUDA from conda-forge and it's super handy. Let me know if this helps.

@gmarkall
Copy link
Contributor

gmarkall commented Jun 3, 2024

I did get everything from conda-forge. I'll carry on looking into this when I get a moment.

@leofang
Copy link
Member Author

leofang commented Oct 29, 2024

Superseded by #111.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants