Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
4c6fb19b
Unverified
Commit
4c6fb19b
authored
Mar 19, 2018
by
Christian Brauner
Committed by
GitHub
Mar 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2225 from flx42/nvidia-hook-fixes
NVIDIA hook improvements
parents
14f16c41
89f1ef11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
nvidia
hooks/nvidia
+22
-2
No files found.
hooks/nvidia
View file @
4c6fb19b
...
@@ -58,6 +58,7 @@ capability_to_cli() {
...
@@ -58,6 +58,7 @@ capability_to_cli() {
case
"
$1
"
in
case
"
$1
"
in
compute
)
echo
"--compute"
;;
compute
)
echo
"--compute"
;;
compat32
)
echo
"--compat32"
;;
compat32
)
echo
"--compat32"
;;
display
)
echo
"--display"
;;
graphics
)
echo
"--graphics"
;;
graphics
)
echo
"--graphics"
;;
utility
)
echo
"--utility"
;;
utility
)
echo
"--utility"
;;
video
)
echo
"--video"
;;
video
)
echo
"--video"
;;
...
@@ -87,12 +88,14 @@ Optional arguments:
...
@@ -87,12 +88,14 @@ Optional arguments:
[ --no-load-kmods ]: Do not try to load the NVIDIA kernel modules.
[ --no-load-kmods ]: Do not try to load the NVIDIA kernel modules.
[ --disable-require ]: Disable all the constraints of the form NVIDIA_REQUIRE_*.
[ --disable-require ]: Disable all the constraints of the form NVIDIA_REQUIRE_*.
[ --debug <path> ]: The path to the log file.
[ --debug <path> ]: The path to the log file.
[ --ldcache <path> ]: The path to the host system's DSO cache.
[ --root <path> ]: The path to the driver root directory.
[ --ldconfig <path> ]: The path to the ldconfig binary, use a '@' prefix for a host path.
[ --ldconfig <path> ]: The path to the ldconfig binary, use a '@' prefix for a host path.
EOF
EOF
return
0
return
0
}
}
options
=
$(
getopt
-o
h
-l
help
,no-load-kmods,disable-require,debug:,ldconfig:
--
"
$@
"
)
options
=
$(
getopt
-o
h
-l
help
,no-load-kmods,disable-require,debug:,ldc
ache:,root:,ldc
onfig:
--
"
$@
"
)
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
usage
usage
exit
1
exit
1
...
@@ -102,6 +105,8 @@ eval set -- "$options"
...
@@ -102,6 +105,8 @@ eval set -- "$options"
CLI_LOAD_KMODS
=
"true"
CLI_LOAD_KMODS
=
"true"
CLI_DISABLE_REQUIRE
=
"false"
CLI_DISABLE_REQUIRE
=
"false"
CLI_DEBUG
=
CLI_DEBUG
=
CLI_LDCACHE
=
CLI_ROOT
=
CLI_LDCONFIG
=
CLI_LDCONFIG
=
while
:
;
do
while
:
;
do
...
@@ -110,6 +115,8 @@ while :; do
...
@@ -110,6 +115,8 @@ while :; do
--no-load-kmods
)
CLI_LOAD_KMODS
=
"false"
;
shift
1
;;
--no-load-kmods
)
CLI_LOAD_KMODS
=
"false"
;
shift
1
;;
--disable-require
)
CLI_DISABLE_REQUIRE
=
"true"
;
shift
1
;;
--disable-require
)
CLI_DISABLE_REQUIRE
=
"true"
;
shift
1
;;
--debug
)
CLI_DEBUG
=
$2
;
shift
2
;;
--debug
)
CLI_DEBUG
=
$2
;
shift
2
;;
--ldcache
)
CLI_LDCACHE
=
$2
;
shift
2
;;
--root
)
CLI_ROOT
=
$2
;
shift
2
;;
--ldconfig
)
CLI_LDCONFIG
=
$2
;
shift
2
;;
--ldconfig
)
CLI_LDCONFIG
=
$2
;
shift
2
;;
--
)
shift
1
;
break
;;
--
)
shift
1
;
break
;;
*
)
break
;;
*
)
break
;;
...
@@ -188,7 +195,7 @@ for req in $(compgen -e "NVIDIA_REQUIRE_"); do
...
@@ -188,7 +195,7 @@ for req in $(compgen -e "NVIDIA_REQUIRE_"); do
done
done
if
[
"
${
CLI_CAPABILITIES
}
"
=
"all"
]
;
then
if
[
"
${
CLI_CAPABILITIES
}
"
=
"all"
]
;
then
CLI_CAPABILITIES
=
"compute compat32 graphics utility video"
CLI_CAPABILITIES
=
"compute compat32
display
graphics utility video"
fi
fi
if
[
-z
"
${
CLI_CAPABILITIES
}
"
]
;
then
if
[
-z
"
${
CLI_CAPABILITIES
}
"
]
;
then
...
@@ -212,6 +219,14 @@ if [ "${USERNS}" = "yes" ]; then
...
@@ -212,6 +219,14 @@ if [ "${USERNS}" = "yes" ]; then
configure_args+
=(
--no-cgroups
)
configure_args+
=(
--no-cgroups
)
fi
fi
if
[
-n
"
${
CLI_LDCACHE
}
"
]
;
then
global_args+
=(
--ldcache
=
"
${
CLI_LDCACHE
}
"
)
fi
if
[
-n
"
${
CLI_ROOT
}
"
]
;
then
global_args+
=(
--root
=
"
${
CLI_ROOT
}
"
)
fi
if
[
-n
"
${
CLI_LDCONFIG
}
"
]
;
then
if
[
-n
"
${
CLI_LDCONFIG
}
"
]
;
then
configure_args+
=(
--ldconfig
=
"
${
CLI_LDCONFIG
}
"
)
configure_args+
=(
--ldconfig
=
"
${
CLI_LDCONFIG
}
"
)
fi
fi
...
@@ -235,5 +250,10 @@ if [ "${CLI_DISABLE_REQUIRE}" = "false" ]; then
...
@@ -235,5 +250,10 @@ if [ "${CLI_DISABLE_REQUIRE}" = "false" ]; then
done
done
fi
fi
if
[
-d
"/sys/kernel/security/apparmor"
]
;
then
# Try to transition to the unconfined AppArmor profile.
echo
"changeprofile unconfined"
>
/proc/self/attr/current
||
true
fi
set
-x
set
-x
exec
nvidia-container-cli
${
global_args
[@]
}
configure
${
configure_args
[@]
}
"
${
LXC_ROOTFS_MOUNT
}
"
exec
nvidia-container-cli
${
global_args
[@]
}
configure
${
configure_args
[@]
}
"
${
LXC_ROOTFS_MOUNT
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment