cuda does not install

未關閉
#71 18 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
15/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cpp, python
領域
build-system

研究方向

The failure is in the JIT path: jit.py calls torch.utils.cpp_extension.load for lltm_cuda.cpp and lltm_cuda_kernel.cu, and the IndexError comes from _get_cuda_arch_flags, where arch_list[-1] is read from an empty list. Start by checking whether the environment exposes a GPU or TORCH_CUDA_ARCH_LIST, since that list is what the code reads. Done means the build either succeeds on a machine with that setup or fails with a clear message. The thread is 18 comments long, with no assignee and no linked pull request, and the last comment was about two years ago.

由索引模型根據 Issue 內容生成。

描述

python : 3.7
cuda : 11.1
pytorch : 1.8

I am trying to compile the cuda code which does not work, could you have a look please? thanks

Traceback (most recent call last):
  File "jit.py", line 3, in <module>
    'lltm_cuda', ['lltm_cuda.cpp', 'lltm_cuda_kernel.cu'], verbose=True)
  File "/user/x/anaconda3/envs/test1/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1091, in load
    keep_intermediates=keep_intermediates)
  File "/user/x/libs/anaconda3/envs/test1/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1302, in _jit_compile
    is_standalone=is_standalone)
  File "/user/x/libs/anaconda3/envs/test1/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1400, in _write_ninja_file_and_build_library
    is_standalone=is_standalone)
  File "/user/x/libs/anaconda3/envs/test1/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1782, in _write_ninja_file_to_build_library
    cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()
  File "/user/x/libs/anaconda3/envs/test1/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1561, in _get_cuda_arch_flags
    arch_list[-1] += '+PTX'

IndexError: list index out of range
主要語言
Python
星號
1.2k
分支
250
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pytorch/extension-cpp 的其他 Issue

查看 pytorch/extension-cpp 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。