zhanghang1989 / zhanghang1989/PyTorch-Encoding

The solution of problem about: no module named 'enclib_cpu' or no module named 'enclib_gpu'

Open
#432 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
448
PR merge metrics
No merged PRs in 30d

Description

If you want to solve this problem, you can follow this reference: https://zhuanlan.zhihu.com/p/191314560
To be specific, you can get 'enclib_cpu.so' or 'enclib_gpu.so' by 'build.ninja' in '/site-packages/encoding/lib/cpu' or '/site-packages/encoding/lib/gpu'.
But in this process, I met a new problem: nvcc fatal: Unsupported gpu architecture 'compute_86'
One widely-used solution is to set environment variables to reduce computing power requirements.
e.g. export TORCH_CUDA_ARCH_LIST="7.5"
CUDA 10.1 does not support compute_86, while CUDA 10.1 supports compute_75 at most.
I failed again. This solution was not worked.
My final solution is edit the 'build.ninja': change '-gencode arch=compute_86, code=sm_86' into '-gencode arch=compute_75, code=sm_75'
I got it!
Hope my experience is helpful for ones struggling the same problem.

note:
My environment settings: Ubuntu 20.04 CUDA 10.1 python=3.6 torch=1.4.1
There are many problems for configuring pytorch-encoding in Windows system, in my experience. So the successful configuration may be easier in Linux or mac.

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 by reviewing the build.ninja files under site-packages/encoding/lib/cpu and site-packages/encoding/lib/gpu, then check how the CUDA architecture is selected for the reported Ubuntu, CUDA 10.1, Python 3.6, and PyTorch 1.4.1 environment. Reproduce the nvcc compute_86 failure and determine whether the supported architecture setting or the workaround should be documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
build-system, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.