Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
2c9839c8
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2c9839c8
编写于
10月 15, 2018
作者:
C
chengduo
提交者:
GitHub
10月 15, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cuda version display (#13885)
test=develop
上级
8e2fdc54
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
8 deletion
+44
-8
paddle/fluid/platform/device_context.cc
paddle/fluid/platform/device_context.cc
+15
-5
paddle/fluid/platform/device_context.h
paddle/fluid/platform/device_context.h
+5
-3
paddle/fluid/platform/gpu_info.cc
paddle/fluid/platform/gpu_info.cc
+18
-0
paddle/fluid/platform/gpu_info.h
paddle/fluid/platform/gpu_info.h
+6
-0
未找到文件。
paddle/fluid/platform/device_context.cc
浏览文件 @
2c9839c8
...
...
@@ -198,9 +198,9 @@ class CudnnHolder {
CUDADeviceContext
::
CUDADeviceContext
(
CUDAPlace
place
)
:
place_
(
place
),
cudnn_holder_
(
nullptr
)
{
SetDeviceId
(
place_
.
device
);
compute_capability
=
GetCUDAComputeCapability
(
place_
.
device
);
multi_process
=
GetCUDAMultiProcessors
(
place_
.
device
);
max_threads_per_mp
=
GetCUDAMaxThreadsPerMultiProcessor
(
place_
.
device
);
compute_capability
_
=
GetCUDAComputeCapability
(
place_
.
device
);
multi_process
_
=
GetCUDAMultiProcessors
(
place_
.
device
);
max_threads_per_mp
_
=
GetCUDAMaxThreadsPerMultiProcessor
(
place_
.
device
);
PADDLE_ENFORCE
(
cudaStreamCreate
(
&
stream_
));
eigen_stream_
.
reset
(
new
EigenCudaStreamDevice
());
eigen_stream_
->
Reinitialize
(
&
stream_
,
place
);
...
...
@@ -211,6 +211,16 @@ CUDADeviceContext::CUDADeviceContext(CUDAPlace place)
cudnn_holder_
.
reset
(
new
CudnnHolder
(
&
stream_
,
place
));
}
driver_version_
=
GetCUDADriverVersion
(
place_
.
device
);
runtime_version_
=
GetCUDARuntimeVersion
(
place_
.
device
);
LOG
(
INFO
)
<<
"device: "
<<
place_
.
device
<<
", CUDA Capability: "
<<
compute_capability_
<<
", Driver Version: "
<<
driver_version_
/
1000
<<
"."
<<
(
driver_version_
%
100
)
/
10
<<
", Runtime Version: "
<<
runtime_version_
/
1000
<<
"."
<<
(
runtime_version_
%
100
)
/
10
;
callback_manager_
.
reset
(
new
StreamCallbackManager
(
stream_
));
}
...
...
@@ -232,11 +242,11 @@ void CUDADeviceContext::Wait() const {
}
int
CUDADeviceContext
::
GetComputeCapability
()
const
{
return
compute_capability
;
return
compute_capability
_
;
}
int
CUDADeviceContext
::
GetMaxPhysicalThreadCount
()
const
{
return
multi_process
*
max_threads_per_mp
;
return
multi_process
_
*
max_threads_per_mp_
;
}
Eigen
::
GpuDevice
*
CUDADeviceContext
::
eigen_device
()
const
{
...
...
paddle/fluid/platform/device_context.h
浏览文件 @
2c9839c8
...
...
@@ -135,9 +135,11 @@ class CUDADeviceContext : public DeviceContext {
cudaStream_t
stream_
;
cublasHandle_t
cublas_handle_
;
int
compute_capability
;
int
multi_process
;
int
max_threads_per_mp
;
int
compute_capability_
;
int
runtime_version_
;
int
driver_version_
;
int
multi_process_
;
int
max_threads_per_mp_
;
mutable
std
::
mutex
mtx_
;
...
...
paddle/fluid/platform/gpu_info.cc
浏览文件 @
2c9839c8
...
...
@@ -46,6 +46,24 @@ int GetCUDAComputeCapability(int id) {
return
device_prop
.
major
*
10
+
device_prop
.
minor
;
}
int
GetCUDARuntimeVersion
(
int
id
)
{
PADDLE_ENFORCE_LT
(
id
,
GetCUDADeviceCount
(),
"id must less than GPU count"
);
int
runtime_version
=
0
;
PADDLE_ENFORCE
(
cudaRuntimeGetVersion
(
&
runtime_version
),
"cudaRuntimeGetVersion failed in "
"paddle::platform::cudaRuntimeGetVersion"
);
return
runtime_version
;
}
int
GetCUDADriverVersion
(
int
id
)
{
PADDLE_ENFORCE_LT
(
id
,
GetCUDADeviceCount
(),
"id must less than GPU count"
);
int
driver_version
=
0
;
PADDLE_ENFORCE
(
cudaDriverGetVersion
(
&
driver_version
),
"cudaDriverGetVersion failed in "
"paddle::platform::GetCUDADriverVersion"
);
return
driver_version
;
}
int
GetCUDAMultiProcessors
(
int
id
)
{
PADDLE_ENFORCE_LT
(
id
,
GetCUDADeviceCount
(),
"id must less than GPU count"
);
int
count
;
...
...
paddle/fluid/platform/gpu_info.h
浏览文件 @
2c9839c8
...
...
@@ -29,6 +29,12 @@ int GetCUDADeviceCount();
//! Get the compute capability of the ith GPU (format: major * 10 + minor)
int
GetCUDAComputeCapability
(
int
i
);
//! Get the runtime version of the ith GPU
int
GetCUDARuntimeVersion
(
int
id
);
//! Get the driver version of the ith GPU
int
GetCUDADriverVersion
(
int
id
);
//! Get the MultiProcessors of the ith GPU.
int
GetCUDAMultiProcessors
(
int
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录