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

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

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

slyubomirsky
Copy link
Contributor

@slyubomirsky slyubomirsky commented Sep 2, 2022

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.

Copy link
Member

@driazati driazati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.18)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also update the requirements in install/from_source.rst to match?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slyubomirsky
Copy link
Contributor Author

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

@junrushao
Copy link
Member

Likely nvcc is not used in the CI

@slyubomirsky
Copy link
Contributor Author

slyubomirsky commented Sep 2, 2022

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

@junrushao
Copy link
Member

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

@areusch
Copy link
Contributor

areusch commented Sep 2, 2022

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

Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slyubomirsky FYI, in #12131 I'm updating the version we build CMake from source to be compliant with what's being proposed here... 3.18.4 exactly. (cc @driazati)

@slyubomirsky
Copy link
Contributor Author

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

@slyubomirsky
Copy link
Contributor Author

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

Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@areusch
Copy link
Contributor

areusch commented Sep 7, 2022

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

@slyubomirsky
Copy link
Contributor Author

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

@driazati
Copy link
Member

driazati commented Sep 7, 2022

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

@slyubomirsky
Copy link
Contributor Author

slyubomirsky commented Sep 9, 2022

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

@slyubomirsky
Copy link
Contributor Author

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

@driazati
Copy link
Member

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

@areusch
Copy link
Contributor

areusch commented Sep 15, 2022

@tvm-bot rerun

@slyubomirsky
Copy link
Contributor Author

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.

@driazati
Copy link
Member

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

@slyubomirsky
Copy link
Contributor Author

Thanks for the reply. Rebasing as advised

@driazati driazati merged commit 8c88aab into apache:main Sep 29, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants