Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install setup of thinc cannot find nvcc in the $PATH #48

Closed
dineshdharme opened this issue Dec 22, 2017 · 2 comments
Closed

Install setup of thinc cannot find nvcc in the $PATH #48

dineshdharme opened this issue Dec 22, 2017 · 2 comments

Comments

@dineshdharme
Copy link

dineshdharme commented Dec 22, 2017

So I was following the guide to install spacy with gpu support : https://spacy.io/usage/
I already have cuda installed with CUDA_HOME variable set as mentioned in the above link
I ran the following command. I have both python2.7 and python3 (-> python3.6)

Related issues :
explosion/spaCy#1247

sudo pip3 install spacy
python3 -c "import thinc.neural.gpu_ops"  

I got the following error,

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'thinc.neural.gpu_ops'

I have successfully installed cupy from Chainer as well. Then uninstalled thinc and again installed thinc. But same error.

I uninstalled thinc and then installed it again with specifying the install log file.
sudo pip3 install thinc --log thinclogs.txt --no-cache-dir

From the logs, it seems that it is unable to find nvcc. But I can clearly access nvcc with nvcc -V command on the terminal.
Here are the relevant logs.

Downloading thinc-6.10.2.tar.gz (1.2MB)
Downloading from URL https://pypi.python.org/packages/55/fd/e9f36081e6f53699943381858848f3b4d759e0dd03c43b98807dde34c252/thinc-6.10.2.tar.gz#md5=41f4cd26d3e894600cdd36e3cd074239 (from https://pypi.python.org/simple/thinc/)
Running setup.py (path:/tmp/pip-build-xmgkus0e/thinc/setup.py) egg_info for package thinc
Running command python setup.py egg_info
Warning: The nvcc binary could not be located in your $PATH. For GPU capability, either add it to your path, or set $CUDA_HOME
running egg_info
creating pip-egg-info/thinc.egg-info
writing pip-egg-info/thinc.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/thinc.egg-info/dependency_links.txt
writing requirements to pip-egg-info/thinc.egg-info/requires.txt
writing top-level names to pip-egg-info/thinc.egg-info/top_level.txt
writing manifest file 'pip-egg-info/thinc.egg-info/SOURCES.txt'
reading manifest file 'pip-egg-info/thinc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.cpp' under directory 'include'
warning: no files found matching 'buildbot.json'
writing manifest file 'pip-egg-info/thinc.egg-info/SOURCES.txt'

Your Environment

  • spaCy version: 2.0.5
  • Platform: Linux-4.13.0-19-generic-x86_64-with-Ubuntu-17.10-artful
  • Python version: 3.6.3
  • Environment Information: I have Cuda 8 with gtx 1080
@mattmelling
Copy link

Same issue here - I found that my PATH environment variable wasn't getting passed through sudo.

There are a few ways to get around this:

  • Install locally with pip install --user thinc
  • Edit your /etc/environment to include your CUDA path, reboot and try installing again.
  • Drop into a root shell via sudo -i, update your PATH and install from there, or use a one liner to force your PATH into the root environment, e.g. sudo PATH=$PATH su -c "pip install thinc"

I couldn't find any reference in the docs about needing to install as root, so local install is probably safest.

@honnibal
Copy link
Member

Finally managed to improve this in 6.11.2:

  • Now smarter about finding the path automatically (at least looks in the default place)
  • You can now specify GPU usage as an "extra", so you can depend on thinc[cuda]. Usefully, you can do thinc[cuda90], thinc[cuda91] or thinc[cuda80] to install the appropriate cupy wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants