fix(env): use conda-forge pytorch-gpu for reliable CUDA builds#11
Merged
fix(env): use conda-forge pytorch-gpu for reliable CUDA builds#11
Conversation
Replace pytorch/nvidia channels + pytorch-cuda=12.4 with conda-forge only + pytorch-gpu meta-package. This matches the working ESA-Datalabs setup and ensures the CUDA variant is installed during Docker builds (with CONDA_OVERRIDE_CUDA="12"). The pytorch-cuda package from the pytorch channel does not constrain the pytorch package to its GPU variant, resulting in CPU-only builds. The conda-forge pytorch-gpu meta-package correctly forces the CUDA variant of pytorch.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
pytorchandnvidiachannels — use onlyconda-forgepytorch-cuda=12.4withpytorch-gpu(conda-forge meta-package)Why
The
pytorch-cudapackage from the pytorch channel does not constrain thepytorchpackage to its GPU variant. The conda solver can satisfy bothpytorch>=2.6andpytorch-cuda=12.4by installing CPU pytorch from conda-forge alongside pytorch-cuda from the pytorch channel.The conda-forge
pytorch-gpumeta-package correctly forces the CUDA variant of pytorch to be installed.Test plan
CONDA_OVERRIDE_CUDA="12" mamba env create -f environment.ymlinstalls pytorch withcuda*build stringpython -c "import torch; print(torch.cuda.is_available())"returnsTrueon GPU node