-
Notifications
You must be signed in to change notification settings - Fork 35
Update and simplify GPU environment setup instructions #602
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b83f5d9
Update and simplify GPU environment setup instructions
marcelovilla 9cd1960
Remove unused image
marcelovilla 187031f
Merge branch 'update-gpu-environment-setup' of https://github.com/neb…
marcelovilla 36d9a59
Improve writing
marcelovilla a6cd03e
Fix header link
marcelovilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,68 +30,24 @@ Overview of using GPUs on Nebari including server setup, environment setup, and | |
|
|
||
| ## 2. Creating environments | ||
|
|
||
| By default, `conda-store` will build CPU-compatible packages. To build GPU-compatible packages, we do the following. | ||
| ### Build a GPU-compatible environment | ||
| By default, `conda-store` will build CPU-compatible packages. To build GPU-compatible packages, we have two options: | ||
| 1. **Create the environment specification using `CONDA_OVERRIDE_CUDA` (recommended approach)**: | ||
|
|
||
| Conda-store provides an alternate mechanism to enable GPU environments via the setting of an environment variable as explained in the [conda-store docs](https://conda.store/conda-store-ui/tutorials/create-envs#set-environment-variables). | ||
| While creating a new config, click on the `**GUI <-> YAML**` Toggle to edit yaml config. | ||
| ``` | ||
| channels: | ||
| - pytorch | ||
| - conda-forge | ||
| dependencies: | ||
| - pytorch | ||
| - ipykernel | ||
| variables: | ||
| CONDA_OVERRIDE_CUDA: "12.1" | ||
| ``` | ||
| Alternatively, you can configure the same config using the UI. | ||
|
|
||
| Add the `CONDA_OVERRIDE_CUDA` override to the variables section to tell conda-store to build a GPU-compatible environment. | ||
| conda-store provides an alternate mechanism to enable GPU environments via the setting of an environment variable as explained in the [conda-store docs](https://conda.store/conda-store-ui/tutorials/create-envs#set-environment-variables). | ||
| Create the environment specification using `CONDA_OVERRIDE_CUDA` by creating a new environment and clicking on the `**GUI <-> YAML**` toggle to edit the yaml config. | ||
| ```yaml | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - pytorch | ||
| - ipykernel | ||
| variables: | ||
| CONDA_OVERRIDE_CUDA: "12.4" | ||
| ``` | ||
| Alternatively, you can configure the same variable using the UI. | ||
|
|
||
| :::note | ||
| At the time of writing this document, the latest CUDA version was showing as `12.1`. Please follow the steps below to determine the latest override value for the `CONDA_OVERRIDE_CUDA` environment variable. | ||
|
|
||
| Please ensure that your choice from PyTorch documentation is not greater than the highest supported version in the `nvidia-smi` output (captured above). | ||
| At the time of writing this document, the latest CUDA version was showing as `12.4`. Please follow the steps [above](#understanding-gpu-setup-on-the-server) to determine the highest supported version to use as an override value for the `CONDA_OVERRIDE_CUDA` environment variable. | ||
| ::: | ||
|
|
||
| 2. **Create the environment specification based on recommendations from the PyTorch documentation**: | ||
| You can check [PyTorch documentation](https://pytorch.org/get-started/locally/) to get a quick list of the necessary CUDA-specific packages. | ||
| Select the following options to get the latest CUDA version: | ||
| - PyTorch Build = Stable | ||
| - Your OS = Linux | ||
| - Package = Conda | ||
| - Language = Python | ||
| - Compute Platform = 12.1 (Select the version that is less than or equal to the `nvidia-smi` output (see above) on your server) | ||
|
|
||
|  | ||
|
|
||
| The command `conda install` from above is: | ||
| ``` | ||
| conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia | ||
| ``` | ||
| The corresponding yaml config would be: | ||
| ``` | ||
| channels: | ||
| - pytorch | ||
| - nvidia | ||
| - conda-forge | ||
| dependencies: | ||
| - pytorch | ||
| - pytorch-cuda==12.1 | ||
| - torchvision | ||
| - torchaudio | ||
| - ipykernel | ||
| variables: {} | ||
| ``` | ||
| :::note | ||
| The order of the channels is respected by conda, so keep pytorch at the top, then nvidia, then conda-forge. | ||
|
|
||
| You can use `**GUI <-> YAML**` Toggle to edit the config. | ||
|
|
||
|
|
||
|
Comment on lines
-60
to
-94
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ## 3. Validating the setup | ||
| You can check that your GPU server is compatible with your conda environment by opening a Jupyter Notebook, loading the environment, and running the following code: | ||
| ``` | ||
|
|
||
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.
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.
The
pytorchchannel has been deprecated and does not have recent versions of PyTorch: pytorch/pytorch#138506