tvm
tvm copied to clipboard
[Bugfix][CMake] Update the minimum CMake version to 3.18
TVM has recently switched to C++17. CUDA support with C++17 requires CMake past version 3.18, according to @vinx13. However, the current CMake version check in CMakeLists.txt
is not checking for a sufficiently high CMake version; this PR updates it.
Bug that prompted this: When building with CMake version 3.16 I had the following error: CUDA_STANDARD is set to invalid value '17'
. Upgrading to the latest CMake (3.24) fixed it.
Interesting, it looks like the CI's CMake version is below 3.18. Is it not using C++17?
Likely nvcc is not used in the CI
Should the version check be conditional, then? I am not especially familiar with CMake but I imagine it's probably possible.
I am a little confused as to how the CI passes with lower versions of CMake while I had a fresh setup that failed, unless it's not using C++17
I don't have much idea how to do such a check if we want to condition whether or not NVCC is used, but it seems possible if we want to warn globally no matter if nvcc is used
shall we also update https://github.com/apache/tvm/blob/main/docker/install/ubuntu_install_cmake_source.sh?
Glad to hear the CI's CMake will be updated. I'll also update the install script.
Ah, I see the last change overlaps with @leandron's PR
looks like some issues with the CI, but retriggering as they may be unrelated.
Is the CI using a higher version of CMake? If not, I think the errors will continue :sweat_smile:
#12131 just merged, we have to update the Docker images to include that before this PR can pass CI
Per this PR, should I make the minimum version higher?
@driazati when do we expect there to be an update?
some of the images were updated to use 3.18 but not all of them, #12774 should clean up the rest so once that is merged and updated on the images this PR should work
@tvm-bot rerun
Hm, some of the builds still use different versions of CMake. Any pointers on where the CMake versions for those are defined? I would be glad to make the changes myself.
Sorry for the delay, #12906 included a Docker image tag update so they should all be on cmake 3.18+ plus now, a rebase on main
should get this PR working
Thanks for the reply. Rebasing as advised