Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lukaCoding
nvidia-container-runtime
提交
9398d41d
N
nvidia-container-runtime
项目概览
lukaCoding
/
nvidia-container-runtime
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nvidia-container-runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9398d41d
编写于
2月 27, 2018
作者:
J
Jonathan Calmels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for display capability
上级
57a0dd58
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
7 deletion
+29
-7
src/cli/configure.c
src/cli/configure.c
+5
-0
src/nvc_info.c
src/nvc_info.c
+10
-2
src/nvc_internal.h
src/nvc_internal.h
+2
-0
src/nvc_mount.c
src/nvc_mount.c
+3
-0
src/options.h
src/options.h
+9
-5
未找到文件。
src/cli/configure.c
浏览文件 @
9398d41d
...
...
@@ -25,6 +25,7 @@ const struct argp configure_usage = {
{
"utility"
,
'u'
,
NULL
,
0
,
"Enable utility capability"
,
-
1
},
{
"video"
,
'v'
,
NULL
,
0
,
"Enable video capability"
,
-
1
},
{
"graphics"
,
'g'
,
NULL
,
0
,
"Enable graphics capability"
,
-
1
},
{
"display"
,
'D'
,
NULL
,
0
,
"Enable display capability"
,
-
1
},
{
"compat32"
,
0x80
,
NULL
,
0
,
"Enable 32bits compatibility"
,
-
1
},
{
"no-cgroups"
,
0x81
,
NULL
,
0
,
"Don't use cgroup enforcement"
,
-
1
},
{
"no-devbind"
,
0x82
,
NULL
,
0
,
"Don't bind mount devices"
,
-
1
},
...
...
@@ -88,6 +89,10 @@ configure_parser(int key, char *arg, struct argp_state *state)
if
(
strjoin
(
&
err
,
&
ctx
->
container_flags
,
"graphics"
,
" "
)
<
0
)
goto
fatal
;
break
;
case
'D'
:
if
(
strjoin
(
&
err
,
&
ctx
->
container_flags
,
"display"
,
" "
)
<
0
)
goto
fatal
;
break
;
case
0x80
:
if
(
strjoin
(
&
err
,
&
ctx
->
container_flags
,
"compat32"
,
" "
)
<
0
)
goto
fatal
;
...
...
src/nvc_info.c
浏览文件 @
9398d41d
...
...
@@ -330,9 +330,10 @@ lookup_binaries(struct error *err, struct nvc_driver_info *info, const char *roo
static
int
lookup_devices
(
struct
error
*
err
,
struct
nvc_driver_info
*
info
,
const
char
*
root
,
int32_t
flags
)
{
struct
nvc_device_node
uvm
,
uvm_tools
,
*
node
;
struct
nvc_device_node
uvm
,
uvm_tools
,
modeset
,
*
node
;
int
has_uvm
=
0
;
int
has_uvm_tools
=
0
;
int
has_modeset
=
0
;
if
(
!
(
flags
&
OPT_NO_UVM
))
{
if
((
has_uvm
=
find_device_node
(
err
,
root
,
NV_UVM_DEVICE_PATH
,
&
uvm
))
<
0
)
...
...
@@ -340,8 +341,13 @@ lookup_devices(struct error *err, struct nvc_driver_info *info, const char *root
if
((
has_uvm_tools
=
find_device_node
(
err
,
root
,
NV_UVM_TOOLS_DEVICE_PATH
,
&
uvm_tools
))
<
0
)
return
(
-
1
);
}
if
(
!
(
flags
&
OPT_NO_MODESET
))
{
modeset
.
path
=
(
char
*
)
NV_MODESET_DEVICE_PATH
;
modeset
.
id
=
makedev
(
NV_DEVICE_MAJOR
,
NV_MODESET_DEVICE_MINOR
);
has_modeset
=
1
;
}
info
->
ndevs
=
(
size_t
)(
1
+
has_uvm
+
has_uvm_tools
);
info
->
ndevs
=
(
size_t
)(
1
+
has_uvm
+
has_uvm_tools
+
has_modeset
);
info
->
devs
=
node
=
xcalloc
(
err
,
info
->
ndevs
,
sizeof
(
*
info
->
devs
));
if
(
info
->
devs
==
NULL
)
return
(
-
1
);
...
...
@@ -352,6 +358,8 @@ lookup_devices(struct error *err, struct nvc_driver_info *info, const char *root
*
(
++
node
)
=
uvm
;
if
(
has_uvm_tools
)
*
(
++
node
)
=
uvm_tools
;
if
(
has_modeset
)
*
(
++
node
)
=
modeset
;
for
(
size_t
i
=
0
;
i
<
info
->
ndevs
;
++
i
)
log_infof
(
"listing device %s"
,
info
->
devs
[
i
].
path
);
...
...
src/nvc_internal.h
浏览文件 @
9398d41d
...
...
@@ -24,10 +24,12 @@
#define NV_DEVICE_MAJOR 195
#define NV_CTL_DEVICE_MINOR 255
#define NV_MODESET_DEVICE_MINOR 254
#define NV_DEVICE_PATH _PATH_DEV "nvidia%d"
#define NV_CTL_DEVICE_PATH _PATH_DEV "nvidiactl"
#define NV_UVM_DEVICE_PATH _PATH_DEV "nvidia-uvm"
#define NV_UVM_TOOLS_DEVICE_PATH _PATH_DEV "nvidia-uvm-tools"
#define NV_MODESET_DEVICE_PATH _PATH_DEV "nvidia-modeset"
#define NV_PERSISTENCED_SOCKET _PATH_VARRUN "nvidia-persistenced/socket"
#define NV_MPS_PIPE_DIR _PATH_TMP "nvidia-mps"
#define NV_PROC_DRIVER "/proc/driver/nvidia"
...
...
src/nvc_mount.c
浏览文件 @
9398d41d
...
...
@@ -466,6 +466,9 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const
/* XXX Only compute libraries require specific devices (e.g. UVM). */
if
(
!
(
cnt
->
flags
&
OPT_COMPUTE_LIBS
)
&&
major
(
info
->
devs
[
i
].
id
)
!=
NV_DEVICE_MAJOR
)
continue
;
/* XXX Only display capability requires the modeset device. */
if
(
!
(
cnt
->
flags
&
OPT_DISPLAY
)
&&
minor
(
info
->
devs
[
i
].
id
)
==
NV_MODESET_DEVICE_MINOR
)
continue
;
if
(
!
(
cnt
->
flags
&
OPT_NO_DEVBIND
))
{
if
((
*
ptr
++
=
mount_device
(
&
ctx
->
err
,
ctx
->
cfg
.
root
,
cnt
,
&
info
->
devs
[
i
]))
==
NULL
)
goto
fail
;
...
...
src/options.h
浏览文件 @
9398d41d
...
...
@@ -29,13 +29,15 @@ static const char * const default_library_opts = "";
enum
{
OPT_NO_GLVND
=
1
<<
0
,
OPT_NO_UVM
=
1
<<
1
,
OPT_NO_MPS
=
1
<<
2
,
OPT_NO_PERSISTENCED
=
1
<<
3
,
OPT_NO_MODESET
=
1
<<
2
,
OPT_NO_MPS
=
1
<<
3
,
OPT_NO_PERSISTENCED
=
1
<<
4
,
};
static
const
struct
option
driver_opts
[]
=
{
{
"no-glvnd"
,
OPT_NO_GLVND
},
{
"no-uvm"
,
OPT_NO_UVM
},
{
"no-modeset"
,
OPT_NO_MODESET
},
{
"no-mps"
,
OPT_NO_MPS
},
{
"no-persistenced"
,
OPT_NO_PERSISTENCED
},
};
...
...
@@ -57,12 +59,13 @@ enum {
OPT_COMPUTE_LIBS
=
1
<<
5
,
OPT_VIDEO_LIBS
=
1
<<
6
,
OPT_GRAPHICS_LIBS
=
1
<<
7
,
OPT_UTILITY_BINS
=
1
<<
8
,
OPT_COMPUTE_BINS
=
1
<<
9
,
OPT_DISPLAY
=
1
<<
8
,
OPT_UTILITY_BINS
=
1
<<
9
,
OPT_COMPUTE_BINS
=
1
<<
10
,
#if defined(__powerpc64__)
/* ppc64le doesn't support compat32. */
OPT_COMPAT32
=
1
<<
0
,
#else
OPT_COMPAT32
=
1
<<
1
0
,
OPT_COMPAT32
=
1
<<
1
1
,
#endif
/* defined(__powerpc64__) */
};
...
...
@@ -75,6 +78,7 @@ static const struct option container_opts[] = {
{
"compute"
,
OPT_COMPUTE_BINS
|
OPT_COMPUTE_LIBS
},
{
"video"
,
OPT_VIDEO_LIBS
|
OPT_COMPUTE_LIBS
},
{
"graphics"
,
OPT_GRAPHICS_LIBS
},
{
"display"
,
OPT_DISPLAY
|
OPT_GRAPHICS_LIBS
},
{
"compat32"
,
OPT_COMPAT32
},
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录