是否可以在Google Colab上安装Cupy? [英] Is it possible to install cupy on google colab?

查看:240
本文介绍了是否可以在Google Colab上安装Cupy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在Google colab上使用GPU运行chainer。这需要安装cupy,但是由于无法在我的colab虚拟机中找到cuda环境,因此无法正确安装它。

I am trying to run chainer with GPU on google colab. This requires cupy installed however I fail to install this properly as it cannot find the cuda environment in my colab vm.

错误消息如下...


收集cupy
正在下载cupy-2.4.0.tar.gz(1.7MB)
100%|██████ ████████████████████████████| 1.7MB 740kB / s
命令python setup.py的完整输出。pyegg_info:
cc1plus:警告:命令行选项'-Wstrict-prototypes'对C / ObjC有效,但对C ++
无效/tmp/tmpds3ikncy/a.cpp:1:10:致命错误:cublas_v2.h:没有这样的文件或目录
#include
^ ~~~~~~~~~~~~
编译终止。
选项:{'profile':False,'linetrace':False,'annotate':False,'no_cuda':False}
*************** ***************************************
*警告:nvcc不在路径中。
*
警告:请设置nvcc的路径。
********************************************** ****
包含目录:[]
库目录:[]
命令'x86_64-linux-gnu-gcc'失败,退出状态为1
***** **************************************************
*警告:包括找不到的文件:['cublas_v2.h','cuda.h','cuda_profiler_api.h','cuda_runtime.h','curand.h','cusparse.h','nvrtc。 h','nvToolsExt.h']
*
警告:跳过安装cuda支持
***警告:检查CFLAGS环境变量
******** **********************************************
追溯(最新最后调用):
文件,第1行,在
文件 /tmp/pip-build-qu5red9h/cupy/setup.py,第32行,在
中,ext_modules = cupy_setup_build。 get_ext_modules()
文件 /tmp/pip-build-qu5red9h/cupy/cupy_setup_build.py,第385行,位于get_ext_modules
扩展= make_extensions(arg_options,编译er,use_cython)
文件 /tmp/pip-build-qu5red9h/cupy/cupy_setup_build.py,第275行,在make_extensions
中引发Exception(’您的CUDA环境无效。 ’
例外:您的CUDA环境无效。请检查上面的错误日志。

Collecting cupy Downloading cupy-2.4.0.tar.gz (1.7MB) 100% |████████████████████████████████| 1.7MB 740kB/s Complete output from command python setup.py egg_info: cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ /tmp/tmpds3ikncy/a.cpp:1:10: fatal error: cublas_v2.h: No such file or directory #include ^~~~~~~~~~~~~ compilation terminated. Options: {'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False} ************************************************** * WARNING: nvcc not in path. * WARNING: Please set path to nvcc. ************************************************** Include directories: [] Library directories: [] command 'x86_64-linux-gnu-gcc' failed with exit status 1 ************************************************** * WARNING: Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'curand.h', 'cusparse.h', 'nvrtc.h', 'nvToolsExt.h'] * WARNING: Skip installing cuda support *** WARNING: Check your CFLAGS environment variable ************************************************** Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-qu5red9h/cupy/setup.py", line 32, in ext_modules = cupy_setup_build.get_ext_modules() File "/tmp/pip-build-qu5red9h/cupy/cupy_setup_build.py", line 385, in get_ext_modules extensions = make_extensions(arg_options, compiler, use_cython) File "/tmp/pip-build-qu5red9h/cupy/cupy_setup_build.py", line 275, in make_extensions raise Exception('Your CUDA environment is invalid. ' Exception: Your CUDA environment is invalid. Please check above error log.



----------------------------------------

命令 python setup.py egg_info失败,错误代码为/ tmp / pip-build-qu5red9h / cupy /

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qu5red9h/cupy/

推荐答案

编辑:Google Colaboratory现在默认提供Chainer,CuPy和iDeep。

Edit: Google Colaboratory now provides Chainer, CuPy and iDeep by default. Manual installation is no longer necessary.

原始答案

您可以使用轮子避免自己在Google Colab上构建CuPy。
Chainer正式提供代码段,以便在Google Colab上安装Chainer / CuPy。

You can use a wheel to avoid building CuPy by yourself on Google Colab. Chainer officially provides snippet to install Chainer/CuPy on Google Colab.

!curl https://colab.chainer.org/install | sh -

这篇关于是否可以在Google Colab上安装Cupy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆