tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bugfix][CMake] Update the minimum CMake version to 3.18

Open slyubomirsky opened this issue 2 years ago • 14 comments

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.

slyubomirsky avatar Sep 02 '22 00:09 slyubomirsky

Interesting, it looks like the CI's CMake version is below 3.18. Is it not using C++17?

slyubomirsky avatar Sep 02 '22 01:09 slyubomirsky

Likely nvcc is not used in the CI

junrushao avatar Sep 02 '22 01:09 junrushao

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

slyubomirsky avatar Sep 02 '22 01:09 slyubomirsky

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

junrushao avatar Sep 02 '22 02:09 junrushao

shall we also update https://github.com/apache/tvm/blob/main/docker/install/ubuntu_install_cmake_source.sh?

areusch avatar Sep 02 '22 14:09 areusch

Glad to hear the CI's CMake will be updated. I'll also update the install script.

slyubomirsky avatar Sep 02 '22 21:09 slyubomirsky

Ah, I see the last change overlaps with @leandron's PR

slyubomirsky avatar Sep 02 '22 21:09 slyubomirsky

looks like some issues with the CI, but retriggering as they may be unrelated.

areusch avatar Sep 07 '22 19:09 areusch

Is the CI using a higher version of CMake? If not, I think the errors will continue :sweat_smile:

slyubomirsky avatar Sep 07 '22 22:09 slyubomirsky

#12131 just merged, we have to update the Docker images to include that before this PR can pass CI

driazati avatar Sep 07 '22 23:09 driazati

Per this PR, should I make the minimum version higher?

slyubomirsky avatar Sep 09 '22 01:09 slyubomirsky

@driazati when do we expect there to be an update?

slyubomirsky avatar Sep 12 '22 20:09 slyubomirsky

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

driazati avatar Sep 14 '22 16:09 driazati

@tvm-bot rerun

areusch avatar Sep 15 '22 22:09 areusch

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.

slyubomirsky avatar Sep 22 '22 20:09 slyubomirsky

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

driazati avatar Sep 27 '22 20:09 driazati

Thanks for the reply. Rebasing as advised

slyubomirsky avatar Sep 28 '22 21:09 slyubomirsky