-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Added a note about hardware requirements for compiling on Linux #70658
Added a note about hardware requirements for compiling on Linux #70658
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than nit on phrasing, seems worthwhile.
8792e38
to
3427ace
Compare
Ping @AnthonyLatsis, what do you think? |
3427ace
to
307d002
Compare
docs/HowToGuides/GettingStarted.md
Outdated
> **Note** | ||
> When building on Linux, make sure to have at least 8 GB of RAM when using flag `--release-debuginfo` and 32 GB of RAM when using flag `--debug-swift`, plus 150 GB of disk space available. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think this should go under "System Requirements". Perhaps we should update the default disk space requirement to 100GB too.
- What’s taking up 150GB on Linux? The entire checkout plus a
--release-debuginfo --debug-swift
build is only about 70GB for me on macOS. - How much RAM was not enough to pull through a
--debug-swift
build, 16GB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go under "System Requirements". Perhaps we should update the default disk space requirement to 100GB too.
Amazing, I did not even notice this section! Surely, updated 🤝
What’s taking up 150GB on Linux? The entire checkout plus a --release-debuginfo --debug-swift build is only about 70GB for me on macOS.
--debug-swift took 78 GB of disk space, plus according to Development Tips it is recommended to set sccache SCCACHE_CACHE_SIZE
environment variable to 50 GB. Then, system size is about 19 GB.
I've ran out of space mostly because I am still unable to compile with --debug-swift --debug-foundation
flags, and have to resort to --release-debuginfo -T --debug-swift-stdlib
to make some progress in crash investigation. Nonetheless, 150 GB is enough to avoid running into a problem with low disk space in the middle of LLVM compilation, for example.
Folders | Size |
---|---|
How much RAM was not enough to pull through a --debug-swift build, 16GB?
Answering your question, 4 GB was my initial VM setup, and I wasted 3 days figuring out why linking was failing, discovered the fact by accident. So my intention with this PR is to let others know how to avoid redundant investigations and work.
Even with 32 GB of RAM, linking of clang-17
binary fails every single time in a VM. On hardware Linux, it'd be better I presume; however, after 2-3 tries I am able to link largest binaries. On the other hand, if to limit concurrent tasks with -j 5
, for instance, failures are more rare, but still occur for the same reason, not enough RAM available.
307d002
to
b5b0f96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Just one more suggestion.
docs/HowToGuides/GettingStarted.md
Outdated
5. RAM: | ||
On Linux, it is recommended to have at least 8 GB of RAM when compiling | ||
with the `--release-debuginfo` build flag and at least 16 GB of RAM available | ||
when compiling with the `--debug-swift` build flag. | ||
For the best experience, 32 GB of RAM is recommended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us provide a reasonable platform-agnostic requirement and stress on emulators at the end. This way, we don’t have to special-case Linux or increase cognitive load with build-script
flags before we even start talking about them.
5. RAM: | |
On Linux, it is recommended to have at least 8 GB of RAM when compiling | |
with the `--release-debuginfo` build flag and at least 16 GB of RAM available | |
when compiling with the `--debug-swift` build flag. | |
For the best experience, 32 GB of RAM is recommended. | |
5. RAM: | |
It is recommended to have at least 8 GB for building a toolchain and 16 GB | |
for development. When building for development on a virtual machine or | |
emulator, you might need more than 32 GB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice rephrasing, thank you for your input 🤝
commit bcc59744b7da00395708f41984ee2be70924cb6c Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Sat Jan 13 15:28:42 2024 +0400 applied suggested phrasing commit b5b0f96 Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Fri Jan 12 23:48:12 2024 +0400 Added a note about hardware requirements for compiling on Linux commit 863c1d98dd8c3c3e67610fe9ea9ac00e161d687a Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Fri Jan 12 23:47:19 2024 +0400 Moved note to Requirements section commit 307d002 Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Wed Jan 10 19:45:54 2024 +0400 Added a note about hardware requirements for compiling on Linux commit 943ccc2726aa2f8850f38670b848304acb3359aa Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Wed Jan 10 19:45:13 2024 +0400 Replaced 'and' with 'plus' to ease comprehension commit 3427ace Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Thu Jan 4 21:02:22 2024 +0400 Added a note about hardware requirements for compiling on Linux commit 49bafe9 Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Thu Jan 4 20:49:35 2024 +0400 Added "of RAM" to each reference commit 9dc879c Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Thu Jan 4 14:13:20 2024 +0400 Updated text according to comment, removed mention of VM for Linux commit b652195 Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Wed Jan 3 00:06:18 2024 +0400 Added more information about different RAM requirements commit 2aa1be0 Author: Ruslan Alikhamov <r.alikhamov@gmail.com> Date: Mon Jan 1 03:19:22 2024 +0400 Added a note about Linux inside of a VM hardware requirements
b5b0f96
to
fd3557b
Compare
@xedin It’s your call now! |
Thank you very much for your approvals 🤝 I wonder what would be the next step, shall we run CI for such change, or just merge? How to proceed, I'd appreciate any hint 👍🏻 |
We’re waiting for a code owner to also approve your changes. ping @xedin |
@xedin ping 🙂 |
@swift-ci please smoke test |
Thanks! |
When I was setting up a Linux VM environment for debugging Swift compiler crash, I faced a number of issues due to low disk space (
update-checkout
would hang before starting concurrent checkouts) and due to low RAM size (linker would start failing when linking symbols forbin/clang-17
and other binaries).This PR adds a note about the minimal RAM requirements, and updates the recommended minimum available disk space.
My findings for when running a Linux VM and compiling the compiler are as follows:
--release-debuginfo
flag--debug
flag