我在EC2上运行了GPU实例,我试图安装cudamat。
我已将副本下载到我的主目录:
git clone https://github.com/cudamat/cudamat
然后我进入该目录并运行: sudo pip install。
错误是"命令' nvcc'退出状态为1失败。
下面是完整的信息: 拆包/ home / ubuntu / cudamat 从file:/// home / ubuntu / cudamat运行setup.py(路径:/tmp/pip-s7db_8yv-build/setup.py)egg_info包 PATH = / usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin 的/ tmp / PIP-s7db_8yv建造
Installing collected packages: cudamat
Running setup.py install for cudamat
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/tmp/pip-s7db_8yv-build
building 'cudamat.libcudamat' extension
nvcc -I/usr/include/python3.4m -c cudamat/cudamat.cu -o build/temp.linux-x86_64-3.4/cudamat/cudamat.o -O --ptxas-options=-v --compiler-options=-fPIC
error: command 'nvcc' failed with exit status 1
Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-s7db_8yv-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nulrhjnl-record/install-record.txt --single-version-externally-managed --compile:
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/tmp/pip-s7db_8yv-build
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/cudamat
copying cudamat/learn.py -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/__init__.py -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/cudamat.py -> build/lib.linux-x86_64-3.4/cudamat
running egg_info
creating cudamat.egg-info
writing cudamat.egg-info/PKG-INFO
writing dependency_links to cudamat.egg-info/dependency_links.txt
writing top-level names to cudamat.egg-info/top_level.txt
writing manifest file 'cudamat.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'cudamat.egg-info/SOURCES.txt'
writing manifest file 'cudamat.egg-info/SOURCES.txt'
copying cudamat/cudamat.cu -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/cudamat_kernels.cu -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/learn.cu -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/learn_kernels.cu -> build/lib.linux-x86_64-3.4/cudamat
copying cudamat/rnd_multipliers_32bit.txt -> build/lib.linux-x86_64-3.4/cudamat
running build_ext
building 'cudamat.libcudamat' extension
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/cudamat
nvcc -I/usr/include/python3.4m -c cudamat/cudamat.cu -o build/temp.linux-x86_64-3.4/cudamat/cudamat.o -O --ptxas-options=-v --compiler-options=-fPIC
error: command 'nvcc' failed with exit status 1
路径有问题。因为找不到nvcc。 当我输入时,继承人:
echo $PATH
/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
有人有想法吗?
欢呼声
答案 0 :(得分:0)
只有在使用sudo时,错误才会显现。
sudo会更改$ PATH变量,具体取决于安全策略。
如果使用以下内容,问题就解决了:
sudo env "PATH=$PATH" pip3 install .
答案 1 :(得分:0)
nvcc没有为sudo访问配置(我可能错误地用这句话来表达,但简而言之,nvcc不适用于sudo)
这个问题有两个解决方案:
安装cudamat时不要使用sudo,而是在cudamat目录中使用以下命令。
python setup.py install --user
注意:
import cudamat
,这将通过错误说明找不到cudamat / cudamat。import cudamat
它将起作用答案 2 :(得分:0)
从github复制
git clone https://github.com/cudamat/cudamat.git
这仅与python 3兼容