Compiler error /cuda/setup.py
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Domaine
- build-system
Piste de recherche
The error comes from cuda/lltm_cuda_kernel.cu at line 54, where a __global__ kernel calls std::fmax, which is host-only. Start by reading the kernel and cuda/setup.py, then compile the CUDA extension with nvcc to reproduce. Done means the extension builds without the device-code error. Linked PR #67 is already open against this issue, so check it before starting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hello,
the compilation of the setup.py in cpp is successful but, for /cuda/setup.py I get the following compile error. Therefore I would like to ask you, if you have an idea what my mistake could be.
Best regards
System:
- OS: Ubuntu 18.04.1 LTS
- PyTorch version: 1.0
- How you installed PyTorch (conda, pip, source): conda
- Python version: 3.6.8
- CUDA/cuDNN version: 10.0
- GPU models and configuration: GeForce GTX 1080 Ti
- GCC version (if compiling from source): 7.3.0
Error log:
rrunning install
running bdist_egg
running egg_info
writing lltm_cuda.egg-info/PKG-INFO
writing dependency_links to lltm_cuda.egg-info/dependency_links.txt
writing top-level names to lltm_cuda.egg-info/top_level.txt
reading manifest file 'lltm_cuda.egg-info/SOURCES.txt'
writing manifest file 'lltm_cuda.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'lltm_cuda' extension
gcc -pthread -B /pizady/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/pizady/anaconda3/include/python3.6m -c lltm_cuda.cpp -o build/temp.linux-x86_64-3.6/lltm_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=lltm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from lltm_cuda.cpp:1:0:
/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include/torch/torch.h:7:2: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]
#warning \
^~~~~~~
/usr/local/cuda/bin/nvcc -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/pizady/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/pizady/anaconda3/include/python3.6m -c lltm_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/lltm_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=lltm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
lltm_cuda_kernel.cu(54): error: calling a __host__ function("std::fmax<double, float> ") from a __global__ function("_NV_ANON_NAMESPACE::lltm_cuda_forward_kernel<float> ") is not allowed
lltm_cuda_kernel.cu(54): error: identifier "std::fmax<double, float> " is undefined in device code
2 errors detected in the compilation of "/tmp/tmpxft_00000f0c_00000000-6_lltm_cuda_kernel.cpp1.ii".
- Langage dominant
- Python
- Étoiles
- 1.2k
- Forks
- 250
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pytorch/extension-cpp
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
pytorch/extension-cpp#100 · 5 commentaires ·
-
Deprecation warningOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
pytorch/extension-cpp#82 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
pytorch/extension-cpp#124 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
pytorch/extension-cpp#123 ·
-
Difficulté 4/5 1-2 jours Accessibilité débutants 12/100
pytorch/extension-cpp#121 · 3 commentaires ·
Toutes les issues de pytorch/extension-cpp
Issues similaires
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
trezor/trezor-user-env#421 ·
-
Support new version of pythonOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Difficulté 1/5 1-3 heures Accessibilité débutants 91/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
tangentcode/tangentswarm#167 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour