在Googlecolab

问题描述 投票:0回答:2
WARNING: nvcc not in path. May need to set CUDA_INC_DIR for installation to succeed

阅读一些博客后,我也做了
!export PATH=/usr/local/cuda/bin:$PATH

!export CUDA_ROOT=/usr/local/cuda

,但仍会出现相同的错误。

此外,在终止安装时,它还显示
In file included from src/cpp/cuda.cpp:1:0:
src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
#include <cuda.h>
          ^~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

此脚本也安装了
pycuda
也需要的软件包:
python python-3.x google-colaboratory pycuda
2个回答
0
投票
!curl https://colab.chainer.org/install | sh -


在2025年,您应该做以下操作:


0
投票

Runtuntime->更改运行时类型 - >硬件加速器:T4 GPU或更高版本!
安装Chainer和Pycuda:

!pip install chainer !pip install pycuda
ImportPycuda

import pycuda.autoinit import pycuda.driver as cuda from pycuda.compiler import SourceModule
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.