【问题标题】:How to resolve "cudaSuccess = err (0 vs. 8)" error on Paddle v0.8.0b?如何解决 Paddle v0.8.0b 上的“cudaSuccess = err (0 vs. 8)”错误?
【发布时间】:2017-02-12 12:03:04
【问题描述】:

我已经使用来自https://github.com/baidu/Paddle/releases/download/V0.8.0b1/paddle-gpu-0.8.0b1-Linux.deb.deb 文件安装了paddlepaddle

我在具有 4 个 GTX 1080 的机器上安装了 CUDA 8.0 和 cudnn v5.1,但没有 NVIDIA Accelerated Graphics Driver

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Sun_Sep__4_22:14:01_CDT_2016
Cuda compilation tools, release 8.0, V8.0.44

我已经设置了 shell 变量:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda

所有cuda 工作正常,因为我已经运行了所有NVIDIA_CUDA-8.0_Samples 并且他们“通过”了所有测试。

Paddle/demo/quick_start 中的quick_start 演示代码也运行流畅,没有抛出错误。

但是当我尝试从 Paddle github 存储库运行 image_classification 演示时,我收到了 invalid device function 错误。有没有办法解决这个问题?

hl_gpu_matrix_kernel.cuh:181] Check failed: cudaSuccess == err (0 vs. 8) [hl_gpu_apply_unary_op failed] CUDA error: invalid device function

完整的追溯:

~/Paddle/demo/image_classification$ bash train.sh 
I1005 14:34:51.929863 10461 Util.cpp:151] commandline: /home/ltan/Paddle/binary/bin/../opt/paddle/bin/paddle_trainer --config=vgg_16_cifar.py --dot_period=10 --log_period=100 --test_all_data_in_one_period=1 --use_gpu=1 --trainer_count=1 --num_passes=200 --save_dir=./cifar_vgg_model 
I1005 14:34:56.705898 10461 Util.cpp:126] Calling runInitFunctions
I1005 14:34:56.706171 10461 Util.cpp:139] Call runInitFunctions done.
[INFO 2016-10-05 14:34:56,918 layers.py:1620] channels=3 size=3072
[INFO 2016-10-05 14:34:56,919 layers.py:1620] output size for __conv_0__ is 32 
[INFO 2016-10-05 14:34:56,920 layers.py:1620] channels=64 size=65536
[INFO 2016-10-05 14:34:56,920 layers.py:1620] output size for __conv_1__ is 32 
[INFO 2016-10-05 14:34:56,922 layers.py:1681] output size for __pool_0__ is 16*16 
[INFO 2016-10-05 14:34:56,923 layers.py:1620] channels=64 size=16384
[INFO 2016-10-05 14:34:56,923 layers.py:1620] output size for __conv_2__ is 16 
[INFO 2016-10-05 14:34:56,924 layers.py:1620] channels=128 size=32768
[INFO 2016-10-05 14:34:56,925 layers.py:1620] output size for __conv_3__ is 16 
[INFO 2016-10-05 14:34:56,926 layers.py:1681] output size for __pool_1__ is 8*8 
[INFO 2016-10-05 14:34:56,927 layers.py:1620] channels=128 size=8192
[INFO 2016-10-05 14:34:56,927 layers.py:1620] output size for __conv_4__ is 8 
[INFO 2016-10-05 14:34:56,928 layers.py:1620] channels=256 size=16384
[INFO 2016-10-05 14:34:56,929 layers.py:1620] output size for __conv_5__ is 8 
[INFO 2016-10-05 14:34:56,930 layers.py:1620] channels=256 size=16384
[INFO 2016-10-05 14:34:56,930 layers.py:1620] output size for __conv_6__ is 8 
[INFO 2016-10-05 14:34:56,932 layers.py:1681] output size for __pool_2__ is 4*4 
[INFO 2016-10-05 14:34:56,932 layers.py:1620] channels=256 size=4096
[INFO 2016-10-05 14:34:56,933 layers.py:1620] output size for __conv_7__ is 4 
[INFO 2016-10-05 14:34:56,934 layers.py:1620] channels=512 size=8192
[INFO 2016-10-05 14:34:56,934 layers.py:1620] output size for __conv_8__ is 4 
[INFO 2016-10-05 14:34:56,936 layers.py:1620] channels=512 size=8192
[INFO 2016-10-05 14:34:56,936 layers.py:1620] output size for __conv_9__ is 4 
[INFO 2016-10-05 14:34:56,938 layers.py:1681] output size for __pool_3__ is 2*2 
[INFO 2016-10-05 14:34:56,938 layers.py:1681] output size for __pool_4__ is 1*1 
[INFO 2016-10-05 14:34:56,941 networks.py:1125] The input order is [image, label]
[INFO 2016-10-05 14:34:56,941 networks.py:1132] The output order is [__cost_0__]
I1005 14:34:56.948256 10461 Trainer.cpp:170] trainer mode: Normal
F1005 14:34:56.949136 10461 hl_gpu_matrix_kernel.cuh:181] Check failed: cudaSuccess == err (0 vs. 8) [hl_gpu_apply_unary_op failed] CUDA error: invalid device function
*** Check failure stack trace: ***
    @     0x7fa557316daa  (unknown)
    @     0x7fa557316ce4  (unknown)
    @     0x7fa5573166e6  (unknown)
    @     0x7fa557319687  (unknown)
    @           0x78a939  hl_gpu_apply_unary_op<>()
    @           0x7536bf  paddle::BaseMatrixT<>::applyUnary<>()
    @           0x7532a9  paddle::BaseMatrixT<>::applyUnary<>()
    @           0x73d82f  paddle::BaseMatrixT<>::zero()
    @           0x66d2ae  paddle::Parameter::enableType()
    @           0x669acc  paddle::parameterInitNN()
    @           0x66bd13  paddle::NeuralNetwork::init()
    @           0x679ed3  paddle::GradientMachine::create()
    @           0x6a6355  paddle::TrainerInternal::init()
    @           0x6a2697  paddle::Trainer::init()
    @           0x53a1f5  main
    @     0x7fa556522f45  (unknown)
    @           0x545ae5  (unknown)
    @              (nil)  (unknown)
/home/xxx/Paddle/binary/bin/paddle: line 81: 10461 Aborted                 (core dumped) ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
No data to plot. Exiting!

根据 git repo 的 issue #158,这个问题应该在 #170 中得到解决,并且支持 GTX 1080 和 CUDA 8.0,但是在访问 GPU 函数时仍然会抛出错误。 (抱歉不能添加超过 2 个信誉低的链接)

有谁知道如何解决这个问题并安装它以便image_classification 可以运行?


我也尝试过从源代码编译 + 安装,而 quick_start 演示运行顺利时抛出了同样的错误。

【问题讨论】:

  • 嗯,您有两个基本选择:学习 C++,开始挑选源代码,找到错误并修复它。选项二是提交错误报告,然后等待。
  • 我不认为这是一个 C++ 错误。 hl_create_global_resources() 表明这是一个与 cuda 相关的东西。
  • 我可以简单地破解一些代码,这些代码会在libstdc++ 的某个地方崩溃。它不会是库错误。欢迎使用 C++。
  • 那台机器上有 CUDA GPU 吗?为什么说“没有 NVIDIA 加速图形驱动程序”?你故意不装驱动?正确的 CUDA 安装包括验证步骤。您是否通过构建和运行一些示例代码来验证 CUDA 是否已正确安装?
  • 是的,我在这台机器上有 4 个 GPU。没有 nvidia 加速图形,因为它与 ubuntu 上的 xserver 配置不兼容。此外,我的 CUDA 7.5 机器可以与 tensorflow 一起使用,并且 CUDA 8.0 上的示例代码也可以运行。只是 paddle-paddle 二进制文件似乎不起作用。

标签: c++ cuda gpu deep-learning paddle-paddle


【解决方案1】:

问题是因为 CUDA 8.0 的 Paddle/cmake/flags.cmake 中为架构设置的标志。

已在https://github.com/baidu/Paddle/pull/165/files 中通过添加compute_52sm_52compute_60sm_60 解决了

【讨论】:

    【解决方案2】:

    我对桨一无所知。但是,几乎可以肯定,CUDA 错误是由您安装的二进制文件不包含您的(相当新的)GTX1080 的代码引起的。要么找到支持 Pascal GPU 的版本,要么从源代码构建您自己的版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-26
      • 1970-01-01
      • 1970-01-01
      • 2019-04-03
      • 1970-01-01
      • 2021-12-19
      • 2020-12-27
      • 2016-02-20
      相关资源
      最近更新 更多