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

Using new Windows runners crashes when conda is called from python script #1054

Closed
atalman opened this issue Nov 9, 2022 · 2 comments
Closed
Assignees

Comments

@atalman
Copy link
Contributor

atalman commented Nov 9, 2022

Using following workflow:
https://github.com/pytorch/test-infra/blob/main/.github/workflows/windows_job.yml

Creates an issue with windows worker when similar code is executed:

def get_anaconda_output_for_package(pkg_name_str):
    import subprocess as sp

    # If we are installing using conda just list package name
    if installation_str.find("conda install") != -1:
        cmd = "conda list --explicit"
        output = sp.getoutput(cmd)
        for item in output.split("\n"):
            if pkg_name_str in item:
                return item
        return f"{pkg_name_str} can't be found"
    else:
        cmd = "conda list -f " + pkg_name_str
        output = sp.getoutput(cmd)
        # Get the last line only
        return output.strip().split('\n')[-1]

following error is observed:

output: 'conda' is not recognized as an internal or external command,
    main()
  File "C:\actions-runner\_work\builder\builder\pytorch\builder\test\smoke_test\smoke_test.py", line 198, in main
operable program or batch file.
    smoke_test_cuda(options.package)
  File "C:\actions-runner\_work\builder\builder\pytorch\builder\test\smoke_test\smoke_test.py", line 99, in smoke_test_cuda
    raise RuntimeError(
RuntimeError: CUDA version issue. Loaded: operable program or batch file. Expected: 11.7
@seemethere
Copy link
Member

Oh this is probably because the subprocess itself doesn't have the same environment variables set up, I wonder if there's a way to pass the environment variables to the subprocess

@atalman
Copy link
Contributor Author

atalman commented Nov 9, 2022

Thanks! I will look into this issue.

@atalman atalman closed this as completed Mar 22, 2023
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

No branches or pull requests

2 participants