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

Fix CUDA_VERSION env var conflict #2807

Merged

Conversation

rsbowman-striveworks
Copy link
Contributor

Description

CUDA_VERSION may be set in the container to the dot separated CUDA version number. This conflicts with the docker build arg CUDA_VERSION used to select which CUDA version to use and results in an error like this when building the image:

....
[1/2] STEP 14/15: RUN     if echo "$BASE_IMAGE" | grep -q "cuda:"; then         if [ "$CUDA_VERSION" ]; then             python ./ts_scripts/install_dependencies.py --cuda $CUDA_VERSION;         else             python ./ts_scripts/install_dependencies.py;         fi;     else         python ./ts_scripts/install_dependencies.py;     fi
usage: install_dependencies.py [-h]
                               [--cuda {cu92,cu101,cu102,cu111,cu113,cu116,cu117,cu118,cu121}]
                               [--neuronx] [--environment {prod,dev}]
                               [--nightly_torch] [--force]
install_dependencies.py: error: argument --cuda: invalid choice: '12.1.1' (choose from 'cu92', 'cu101', 'cu102', 'cu111', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121')
Error: building at STEP "RUN if echo "$BASE_IMAGE" | grep -q "cuda:"; then         if [ "$CUDA_VERSION" ]; then             python ./ts_scripts/install_dependencies.py --cuda $CUDA_VERSION;         else             python ./ts_scripts/install_dependencies.py;         fi;     else         python ./ts_scripts/install_dependencies.py;     fi": while running runtime: exit status 2

Rename the docker build arg to USE_CUDA_VERSION to avoid the conflict.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Feature/Issue validation/testing

This was tested by building several images with the build_image.sh script.

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

CUDA_VERSION may be set in the container to the dot separated CUDA
version number.  This conflicts with the docker build arg CUDA_VERSION
used to select which CUDA version to use.  Rename the latter to
USE_CUDA_VERSION to avoid the conflict.
Copy link
Collaborator

@agunapal agunapal left a comment

Choose a reason for hiding this comment

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

Interesting find. Thanks for the PR. LGTM

@agunapal agunapal added this pull request to the merge queue Nov 22, 2023
Merged via the queue into pytorch:master with commit 2e1d7c6 Nov 23, 2023
13 checks passed
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.

None yet

2 participants