JIT cpp extension fails to find cl.exe on windows?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 18/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- build-system
Rechercherichtung
The failure comes from torch.utils.cpp_extension, not from this repo: _write_ninja_file runs subprocess.check_output(['where', 'cl']), which fails when MSVC's cl.exe is not on PATH. Read that function and the load() call in the issue's traceback, then reproduce on Windows with a Visual Studio Build Tools environment. Done means either a documented setup fix or a clearer error message, and the issue has no assignee, no linked pull request and no answer in 780 days.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I am trying to use the JIT cpp extension, and have a script from my friend, who is able to run it in linux, but whenever I run it on windows, it fails. The error is quite clear, it seems like it can’t find the cl.exe compiler.
The script fails on the load statement below:
import torch
from torch.utils.cpp_extension import load
from torch.nn.modules.utils import _triple
# load the PyTorch extension
cudnn_convolution = load(name="cudnn_convolution", sources=["src/reversible_network/cudnn_convolution.cpp"], verbose=True)
With the following message:
C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 51413 --file C:/Users/Tue/PycharmProjects/DistogramPredictor/run.py
pydev debugger: process 10460 is connecting
Connected to pydev debugger (build 201.6668.115)
Using C:\Users\Tue\AppData\Local\Temp\torch_extensions as PyTorch extensions root...
C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py:237: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
Emitting ninja build file C:\Users\Tue\AppData\Local\Temp\torch_extensions\cudnn_convolution\build.ninja...
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Tue\PycharmProjects\DistogramPredictor\src\main.py", line 12, in <module>
from src.reversible_network.hypernet import HyperNet
File "C:\Users\Tue\PycharmProjects\DistogramPredictor\src\reversible_network\hypernet.py", line 6, in <module>
from src.reversible_network.doublesym import DoubleSymLayer3D
File "C:\Users\Tue\PycharmProjects\DistogramPredictor\src\reversible_network\doublesym.py", line 5, in <module>
from src.reversible_network.grad import conv3d_weight
File "C:\Users\Tue\PycharmProjects\DistogramPredictor\src\reversible_network\grad.py", line 6, in <module>
cudnn_convolution = load(name="cudnn_convolution", sources=["src/reversible_network/cudnn_convolution.cpp"], verbose=True)
File "C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py", line 888, in load
return _jit_compile(
File "C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1077, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1171, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1509, in _write_ninja_file_to_build_library
_write_ninja_file(
File "C:\Users\Tue\PycharmProjects\Epitopes_segmentation\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1615, in _write_ninja_file
cl_paths = subprocess.check_output(['where',
File "C:\Users\Tue\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\Tue\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.
I’m running python 3.8 and a pip list gives the following:
(venv) C:\Users\Tue\PycharmProjects\DistogramPredictor>pip list
Package Version
------------------- ------------
beautifulsoup4 4.9.1
biopython 1.77
blis 0.4.1
bs4 0.0.1
catalogue 1.0.0
certifi 2020.6.20
chardet 3.0.4
click 7.1.2
cssselect 1.1.0
cycler 0.10.0
cymem 2.0.3
dill 0.3.2
en-core-web-sm 2.3.0
filelock 3.0.12
fire 0.3.1
fr-core-news-sm 2.3.0
future 0.18.2
h5py 2.10.0
hnswlib 0.3.4
idna 2.10
joblib 0.16.0
Keras 2.4.3
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
kiwisolver 1.2.0
lmdb 0.98
lxml 4.5.2
matplotlib 3.2.1
msgpack 1.0.0
murmurhash 1.0.2
ninja 1.10.0.post1
nltk 3.5
numpy 1.18.5
packaging 20.4
pandas 1.0.4
parse 1.15.0
Pillow 7.1.2
pip 20.2.2
plac 1.1.3
preshed 3.0.2
pyarrow 0.17.1
pybind11 2.5.0
pyparsing 2.4.7
pyquery 1.4.1
python-dateutil 2.8.1
pytz 2020.1
pywebcopy 6.3.0
PyYAML 5.3.1
regex 2020.6.8
requests 2.24.0
sacremoses 0.0.43
scipy 1.4.1
seaborn 0.10.1
sentencepiece 0.1.91
seqeval 0.0.12
setuptools 47.2.0
six 1.15.0
soupsieve 2.0.1
spacy 2.3.0
srsly 1.0.2
termcolor 1.1.0
thinc 7.4.1
tokenizers 0.8.0rc4
torch 1.5.0
torchtext 0.6.0
torchvision 0.6.0
tqdm 4.47.0
urllib3 1.25.9
w3lib 1.22.0
wasabi 0.7.0
wget 3.2
How can I fix this issue?
- Vorherrschende Sprache
- Python
- Sterne
- 1.2k
- Forks
- 250
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pytorch/extension-cpp
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
pytorch/extension-cpp#100 · 5 Kommentare ·
-
Deprecation warningOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
pytorch/extension-cpp#82 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
pytorch/extension-cpp#124 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
pytorch/extension-cpp#123 ·
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 12/100
pytorch/extension-cpp#121 · 3 Kommentare ·
Alle Issues in pytorch/extension-cpp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Evtl. vergeben @cestercian hat das heute übernommen. Offencomp/cli P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NousResearch/hermes-agent#162259 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[request] gRpc/1.86.0Offenupstream update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
conan-io/conan-center-index#31597 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
AOSSIE-Org/PictoPy#1802 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
community-request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer antworten meist innerhalb von 1 Tag