日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【CUDA开发】 Check failed: error == cudaSuccess (8 vs. 0) invalid device function

發布時間:2025/3/15 编程问答 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【CUDA开发】 Check failed: error == cudaSuccess (8 vs. 0) invalid device function 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近在復現R-CNN一系列的實驗時,配置代碼環境真是花費了不少時間。由于對MATLAB不熟悉,實驗采用的都是github上rbg大神的Python版本。在配置Faster R-CNN時,編譯沒有問題,一運行 ./tools/demo.py --net zf ?就會出現如下錯誤:


<span style="font-size:14px;">Loaded network ./data/faster_rcnn_models/ZF_faster_rcnn_final.caffemodel ? ?
F1008 ?roi_pooling_layer.cu:91] Check failed: error == cudaSuccess (8 vs. 0) invalid device function ? ?
*** Check failure stack trace: *** ?</span> ?


但是采用CPU?mode運行時可以成功。

最后在https://github.com/rbgirshick/py-faster-rcnn/issues/2 找到了我想要的答案,有興趣的可以慢慢閱讀。

不想看的話,就直接按照我下面的方式修改。

一般情況下都是因為顯卡的計算能力不同而導致的,修改?py-faster-rcnn/lib/setup.py?的第135行,將arch改為與你顯卡相匹配的數值,(比如我的GTX?760,計算能力是3.0,就將sm_35改成了sm_30)然后刪除utils/bbox.c,nms/cpu_nms.c?,nms/gpu_nms.cpp?重新編譯即可


我看到有些人說還有其他的問題,那么可以在最開始的makefile.config文件中就開始修改,不過我沒有試過,具體步驟如下


  • <span?style="font-size:14px;">As?below,?there?is?my?solution?(thress?steps):????
  • 1?if?you're?using?the?GPU?instance?on?AWS,?then?please?change?the?architecture?setting?into:????
  • #?CUDA?architecture?setting:?going?with?all?of?them.????
  • #?For?CUDA?<?6.0,?comment?the?*_50?lines?for?compatibility.????
  • CUDA_ARCH?:=?-gencode?arch=compute_30,code=sm_30?\????
  • -gencode?arch=compute_50,code=sm_50?\????
  • -gencode?arch=compute_50,code=compute_50????
  • Because?the?GPU?in?AWS?does?not?support?compute_35????
  • 2?I?changed?sm_35?into?sm_30?in?lib/setup.py?file????
  • 3?cd?lib,?remove?these?files:?utils/bbox.c?nms/cpu_nms.c?nms/gpu_nms.cpp,?if?they?exist.????
  • And?then?make?&&?cd?../caffe/?&&?make?clean?&&?make?-j8?&&?make?pycaffe?-j8??</span>??
  • 轉載于:https://www.cnblogs.com/huty/p/8517108.html

    總結

    以上是生活随笔為你收集整理的【CUDA开发】 Check failed: error == cudaSuccess (8 vs. 0) invalid device function的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。