From 4b3d3b89aaa3919b67ab7b60f0af3e1611e84642 Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 24 Oct 2023 18:16:52 -0700 Subject: [PATCH] Use runtime option instead of using nvidia-docker command nvidia-docker binary is not available if user doesn't install nvidia-docker2 package. This change uses runtime option instead of using nvidia-docker command. Signed-off-by: Gigon Bae --- dockcross-manylinux2014-x64 | 2 +- python/cucim/docs/getting_started/index.md | 2 +- run | 4 ++-- scripts/run-dist | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dockcross-manylinux2014-x64 b/dockcross-manylinux2014-x64 index 18e7f50a9..e6edf726e 100755 --- a/dockcross-manylinux2014-x64 +++ b/dockcross-manylinux2014-x64 @@ -233,7 +233,7 @@ fi TTY_ARGS= tty -s && [ -z "$MSYS" ] && TTY_ARGS=-ti CONTAINER_NAME=dockcross_$RANDOM -nvidia-docker run $TTY_ARGS --name $CONTAINER_NAME \ +docker run --runtime nvidia $TTY_ARGS --name $CONTAINER_NAME \ -v "$HOST_PWD":/work \ $HOST_VOLUMES \ "${USER_IDS[@]}" \ diff --git a/python/cucim/docs/getting_started/index.md b/python/cucim/docs/getting_started/index.md index 5b20d080a..5eff46f3f 100644 --- a/python/cucim/docs/getting_started/index.md +++ b/python/cucim/docs/getting_started/index.md @@ -99,7 +99,7 @@ After executing the command, type a password for the instance and open a web bro ```bash ... Port 10001 would be used...(http://172.26.120.129:10001) -2021-02-13 01:12:44 $ nvidia-docker run --gpus all -it --rm -v /home/repo/cucim/notebooks:/notebooks -p 10001:10001 cucim-jupyter -c echo -n 'Enter New Password: '; jupyter lab --ServerApp.password="$(python3 -u -c "from jupyter_server.auth import passwd;pw=input();print(passwd(pw));" | egrep 'sha|argon')" --ServerApp.root_dir=/notebooks --allow-root --port=10001 --ip=0.0.0.0 --no-browser +2021-02-13 01:12:44 $ docker run --runtime nvidia --gpus all -it --rm -v /home/repo/cucim/notebooks:/notebooks -p 10001:10001 cucim-jupyter -c echo -n 'Enter New Password: '; jupyter lab --ServerApp.password="$(python3 -u -c "from jupyter_server.auth import passwd;pw=input();print(passwd(pw));" | egrep 'sha|argon')" --ServerApp.root_dir=/notebooks --allow-root --port=10001 --ip=0.0.0.0 --no-browser Enter New Password: [I 2021-02-13 01:12:47.981 ServerApp] dask_labextension | extension was successfully linked. [I 2021-02-13 01:12:47.981 ServerApp] jupyter_server_proxy | extension was successfully linked. diff --git a/run b/run index a9e666350..b39fee6ac 100755 --- a/run +++ b/run @@ -984,14 +984,14 @@ launch_notebooks() { run_command cp ${TOP}/dist/*.whl ${TOP}/notebooks - run_command nvidia-docker build -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix}-dev ${TOP} + run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix}-dev ${TOP} [ $? -ne 0 ] && return 1 c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")" if [ -z "${gds_postfix}" ]; then - run_command nvidia-docker run --gpus all -it --rm \ + run_command docker run --runtime nvidia --gpus all -it --rm \ -v ${TOP}/notebooks:/notebooks \ -p ${port}:${port} \ cucim-jupyter \ diff --git a/scripts/run-dist b/scripts/run-dist index af26406f4..60ed771e0 100755 --- a/scripts/run-dist +++ b/scripts/run-dist @@ -307,14 +307,14 @@ launch_notebooks() { run_command cp ${TOP}/*.whl ${TOP}/notebooks - run_command nvidia-docker build -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP} + run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP} [ $? -ne 0 ] && return 1 c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")" if [ -z "${gds_postfix}" ]; then - run_command nvidia-docker run --gpus all -it --rm \ + run_command docker run --runtime nvidia --gpus all -it --rm \ -v ${TOP}/notebooks:/notebooks \ -p ${port}:${port} \ cucim-jupyter \