Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
dc315df9
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dc315df9
编写于
9月 08, 2020
作者:
L
lizhenyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add find CuDNN module in CMakeLists.txt
上级
e4c992aa
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
35 addition
and
9 deletion
+35
-9
build.sh
build.sh
+1
-2
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+33
-6
mindspore/ccsrc/minddata/dataset/CMakeLists.txt
mindspore/ccsrc/minddata/dataset/CMakeLists.txt
+1
-1
未找到文件。
build.sh
浏览文件 @
dc315df9
...
...
@@ -17,7 +17,6 @@
set
-e
BASEPATH
=
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
CUDA_PATH
=
""
CUDNN_PATH
=
""
export
BUILD_PATH
=
"
${
BASEPATH
}
/build/"
# print usage message
usage
()
...
...
@@ -364,7 +363,7 @@ build_mindspore()
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_D=ON"
fi
if
[[
"X
$ENABLE_GPU
"
=
"Xon"
]]
;
then
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_GPU=ON -DUSE_CUDA=ON -DCUDA_PATH=
$CUDA_PATH
-D
CUDNN_PATH=
$CUDNN_PATH
-D
MS_REQUIRE_CUDA_VERSION=
${
CUDA_VERSION
}
"
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_GPU=ON -DUSE_CUDA=ON -DCUDA_PATH=
$CUDA_PATH
-DMS_REQUIRE_CUDA_VERSION=
${
CUDA_VERSION
}
"
fi
if
[[
"X
$ENABLE_CPU
"
=
"Xon"
]]
;
then
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_CPU=ON"
...
...
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
dc315df9
...
...
@@ -21,23 +21,50 @@ if(ENABLE_GPU)
endif
()
enable_language
(
CUDA
)
if
(
NOT CUDA_PATH OR CUDA_PATH STREQUAL
""
)
if
(
DEFINED ENV{CUDA_HOME}
)
if
(
DEFINED ENV{CUDA_HOME}
AND NOT $ENV{CUDA_HOME} STREQUAL
""
)
set
(
CUDA_PATH $ENV{CUDA_HOME}
)
else
()
set
(
CUDA_PATH
${
CUDA_TOOLKIT_ROOT_DIR
}
)
endif
()
endif
()
if
(
NOT CUDNN_PATH OR CUDNN_PATH STREQUAL
""
)
set
(
CUDNN_PATH
${
CUDA_PATH
}
)
if
(
DEFINED ENV{CUDNN_HOME} AND NOT $ENV{CUDNN_HOME} STREQUAL
""
)
set
(
CUDNN_INCLUDE_DIR $ENV{CUDNN_HOME}/include
)
set
(
CUDNN_LIBRARY_DIR $ENV{CUDNN_HOME}/lib64
)
find_path
(
CUDNN_INCLUDE_PATH cudnn.h HINTS
${
CUDNN_INCLUDE_DIR
}
NO_DEFAULT_PATH
)
find_library
(
CUDNN_LIBRARY_PATH
"cudnn"
HINTS
${
CUDNN_LIBRARY_DIR
}
NO_DEFAULT_PATH
)
if
(
CUDNN_INCLUDE_PATH STREQUAL CUDNN_INCLUDE_PATH-NOTFOUND
)
message
(
FATAL_ERROR
"Failed to find cudnn header file, please set environment variable CUDNN_HOME to cudnn installation position."
)
endif
()
if
(
CUDNN_LIBRARY_PATH STREQUAL CUDNN_LIBRARY_PATH-NOTFOUND
)
message
(
FATAL_ERROR
"Failed to find cudnn library file, please set environment variable CUDNN_HOME to cudnn installation position."
)
endif
()
else
()
list
(
APPEND CMAKE_PREFIX_PATH
${
CUDA_TOOLKIT_ROOT_DIR
}
)
find_path
(
CUDNN_INCLUDE_PATH cudnn.h PATH_SUFFIXES cuda/inclulde include cuda
)
find_library
(
CUDNN_LIBRARY_PATH
"cudnn"
PATH_SUFFIXES cuda/lib64 lib64 lib cuda/lib lib/x86_64-linux-gnu
)
if
(
CUDNN_INCLUDE_PATH STREQUAL CUDNN_INCLUDE_PATH-NOTFOUND
)
message
(
FATAL_ERROR
"Failed to find cudnn header file, if cudnn library is not installed, please put cudnn header file in cuda include path \
or user include path(eg. /usr/local/cuda/include; /usr/local/include; /usr/include), if cudnn library is installed in other position,\
please set environment variable CUDNN_HOME to cudnn installation position, there should be cudnn.h in {CUDNN_HOME}/include."
)
endif
()
if
(
CUDNN_LIBRARY_PATH STREQUAL CUDNN_LIBRARY_PATH-NOTFOUND
)
message
(
FATAL_ERROR
"Failed to find cudnn library file, if cudnn library is not installed, please put cudnn library file in \
cuda library path or user library path(eg. /usr/local/cuda/lib64; /usr/local/lib64; /usr/lib64; /usr/local/lib; /usr/lib),\
if cudnn library is installed in other position, please set environment variable CUDNN_HOME to cudnn installation position, \
there should be cudnn library file in {CUDNN_HOME}/lib64."
)
endif
()
endif
()
if
(
NOT CUPTI_INCLUDE_DIRS OR CUPTI_INCLUDE_DIRS STREQUAL
""
)
set
(
CUPTI_INCLUDE_DIRS
${
CUDA_PATH
}
/extras/CUPTI/include
)
endif
()
message
(
"CUDA_PATH:
${
CUDA_PATH
}
"
)
message
(
"CUDA_INCLUDE_DIRS:
${
CUDA_INCLUDE_DIRS
}
"
)
message
(
"CUDNN_PATH:
${
CUDNN_PATH
}
"
)
message
(
"CUDNN_INCLUDE_PATH:
${
CUDNN_INCLUDE_PATH
}
"
)
message
(
"CUDNN_LIBRARY_PATH:
${
CUDNN_LIBRARY_PATH
}
"
)
message
(
"CUPTI_INCLUDE_DIRS:
${
CUPTI_INCLUDE_DIRS
}
"
)
include_directories
(
${
CUDNN_PATH
}
${
CUDA_PATH
}
${
CUDA_INCLUDE_DIRS
}
${
CUPTI_INCLUDE_DIRS
}
)
include_directories
(
${
CUDNN_
INCLUDE_
PATH
}
${
CUDA_PATH
}
${
CUDA_INCLUDE_DIRS
}
${
CUPTI_INCLUDE_DIRS
}
)
file
(
GLOB_RECURSE GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"runtime/device/gpu/*.cc"
...
...
@@ -261,7 +288,7 @@ if (ENABLE_GPU)
message
(
"add gpu lib to c_expression"
)
target_link_libraries
(
_c_expression PRIVATE gpu_cuda_lib gpu_queue cublas
${
CUDA_PATH
}
/lib64/libcurand.so
${
CUDNN_
PATH
}
/lib64/libcudnn.so
${
CUDNN_
LIBRARY_PATH
}
${
CUDA_PATH
}
/lib64/libcudart.so
${
CUDA_PATH
}
/lib64/stubs/libcuda.so
${
CUDA_PATH
}
/lib64/libcusolver.so
)
...
...
mindspore/ccsrc/minddata/dataset/CMakeLists.txt
浏览文件 @
dc315df9
...
...
@@ -152,7 +152,7 @@ target_link_libraries(_c_dataengine PUBLIC mindspore::jpeg_turbo mindspore::turb
mindspore::opencv_imgproc mindspore::tinyxml2 mindspore::sentencepiece mindspore::sentencepiece_train
${
ICU_LIB
}
)
if
(
ENABLE_GPUQUE
)
target_link_libraries
(
_c_dataengine PRIVATE gpu_queue
${
CUDNN_
PATH
}
/lib64/libcudnn.so
${
CUDNN_
LIBRARY_PATH
}
${
CUDA_PATH
}
/lib64/libcudart.so
${
CUDA_PATH
}
/lib64/stubs/libcuda.so
)
endif
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录