NVIDIA / NVIDIA/apex

Issue Installing Apex in WSL Environment

Open
#1,676 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

🐛 Bug

I'm having a problem installing Apex in a WSL environment. It seems the installation script for Apex is trying to find the CUDA installation directory and run the nvcc -V command. In a WSL environment, despite CUDA being supported through the NVIDIA WSL driver, there may not exist a proper CUDA installation directory, and nvcc may not be added to the PATH environment variable.

To Reproduce
I attempted to install Apex in WSL using the following commands:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir ./

I then received the following error:

File "/home/ldd/nlp/apex/setup.py", line 130, in <module>
  _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ldd/nlp/apex/setup.py", line 17, in get_cuda_bare_metal_version
  raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
                                        ~~~~~~~~~^~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Expected behavior
I would expect Apex to be installable in a WSL environment without needing a full CUDA installation directory or nvcc.

Environment

OS: Ubuntu 20.04 on WSL 2
Python version: 3.11
PyTorch version: 2.0.1
CUDA version: NVIDIA CUDA 11.3 driver for Windows
GPU models: [e.g. NVIDIA RTX 2080]
Apex version: master branch as of 2023-06-06
GCC version: [e.g. 7.5]
Any other relevant information:
Additional context
I'm trying to run a deep learning project that depends on Apex. I'm unable to run this project as Apex cannot be installed in my WSL environment.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup.py, especially get_cuda_bare_metal_version and the CUDA_HOME handling shown in the traceback. Reproduce the pip install command in WSL 2, then determine whether installation can work without a CUDA directory or nvcc; done means the documented environment installs Apex without this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.