ERROR: /Users/llv23/Documents/05_machine_learning/dl_gpu_mac/crack_by_TomHeaven/tensorflow-2.3.0-macos/tensorflow/stream_executor/cuda/BUILD:457:1: C++ compilation of rule '//tensorflow/stream_executor/cuda:cusparse_stub' failed (Exit 1)
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7786:21: error: unknown type name 'cusparseSpVecDescr_t'
cusparseCreateSpVec(cusparseSpVecDescr_t *spVecDescr, int64_t size, int64_t nnz,
^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7790:7: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
cusparseSpVecDescr_t *, int64_t, int64_t, void *, void *,
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7799:22: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
cusparseDestroySpVec(cusparseSpVecDescr_t spVecDescr) {
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7800:51: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
using FuncPtr = cusparseStatus_t(CUSPARSEAPI *)(cusparseSpVecDescr_t);
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7807:11: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
const cusparseSpVecDescr_t spVecDescr, int64_t *size, int64_t *nnz,
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7811:13: error: C++ requires a type specifier for all declarations
const cusparseSpVecDescr_t, int64_t *, int64_t *, void **, void **,
~~~~~ ^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7815:19: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const cusparseSpMatDescr_t' (aka 'cusparseSpMatDescr *const')
return func_ptr(spVecDescr, size, nnz, indices, values, idxType, idxBase,
^~~~~~~~~~
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7820:11: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
const cusparseSpVecDescr_t spVecDescr, cusparseIndexBase_t *idxBase) {
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7821:57: error: C++ requires a type specifier for all declarations
using FuncPtr = cusparseStatus_t(CUSPARSEAPI *)(const cusparseSpVecDescr_t,
~~~~~ ^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7825:19: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const cusparseSpMatDescr_t' (aka 'cusparseSpMatDescr *const')
return func_ptr(spVecDescr, idxBase);
^~~~~~~~~~
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7829:30: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
cusparseSpVecGetValues(const cusparseSpVecDescr_t spVecDescr, void **values) {
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7831:45: error: C++ requires a type specifier for all declarations
cusparseStatus_t(CUSPARSEAPI *)(const cusparseSpVecDescr_t, void **);
~~~~~ ^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7834:19: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const cusparseSpMatDescr_t' (aka 'cusparseSpMatDescr *const')
return func_ptr(spVecDescr, values);
^~~~~~~~~~
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7838:24: error: unknown type name 'cusparseSpVecDescr_t'; did you mean 'cusparseSpMatDescr_t'?
cusparseSpVecSetValues(cusparseSpVecDescr_t spVecDescr, void *values) {
^~~~~~~~~~~~~~~~~~~~
cusparseSpMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6964:36: note: 'cusparseSpMatDescr_t' declared here
typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7839:51: error: C++ requires a type specifier for all declarations
using FuncPtr = cusparseStatus_t(CUSPARSEAPI *)(cusparseSpVecDescr_t, void *);
^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7842:19: error: cannot initialize a parameter of type 'int' with an lvalue of type 'cusparseSpMatDescr_t' (aka 'cusparseSpMatDescr *')
return func_ptr(spVecDescr, values);
^~~~~~~~~~
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7846:21: error: unknown type name 'cusparseDnVecDescr_t'
cusparseCreateDnVec(cusparseDnVecDescr_t *dnVecDescr, int64_t size,
^
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7849:7: error: unknown type name 'cusparseDnVecDescr_t'; did you mean 'cusparseDnMatDescr_t'?
cusparseDnVecDescr_t *, int64_t, void *, cudaDataType);
^~~~~~~~~~~~~~~~~~~~
cusparseDnMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6965:36: note: 'cusparseDnMatDescr_t' declared here
typedef struct cusparseDnMatDescr* cusparseDnMatDescr_t;
^
In file included from tensorflow/stream_executor/cuda/cusparse_stub.cc:59:
./tensorflow/stream_executor/cuda/cusparse_10_1.inc:7856:22: error: unknown type name 'cusparseDnVecDescr_t'; did you mean 'cusparseDnMatDescr_t'?
cusparseDestroyDnVec(cusparseDnVecDescr_t dnVecDescr) {
^~~~~~~~~~~~~~~~~~~~
cusparseDnMatDescr_t
bazel-out/darwin-opt/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h:6965:36: note: 'cusparseDnMatDescr_t' declared here
typedef struct cusparseDnMatDescr* cusparseDnMatDescr_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
@TomHeaven 想问一下,你下面这个issue是如何解决的 我的环境 macOS 10.13.6 Xcode 10.1 CUDA 10.1 cuDNN 7.6.5 我看你在这个帖子里也在讨论: https://github.com/TomHeaven/tensorflow-osx-build/issues/18 在https://github.com/tensorflow/tensorflow/issues/40260 里面提到用环境变量,我尝试过,但仍然报错
我的环境变量如下:
我比较了和你的env差别,怀疑是不是cuda的include缺失;我加了试验一下,让机器跑个晚上,看明天是不是还有这个错
刚刚find了一下,结果发现确实在/usr/local/cuda/include/cusparse.h里面,soft link到/Developer/NVIDIA/CUDA-10.1/include/cusparse.h ,希望明早起来这个错误消失吧,编译一次时间巨长 还是没有找到,感觉在include bazel-out/host/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual/third_party/gpus/cuda/include/cusparse.h的时候,有问题
大兄弟,我发现我的CUDA10.1好像不是update2,NVIDA应该是在10.1update2之后才加入的cusparseSpVecDescr_t。。。哎,hopefully sail through