From 432741bb55f98530970dc2c03f67abf02b0e4a79 Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Wed, 19 Oct 2022 16:53:03 +0200 Subject: [PATCH 1/2] Update Makefile to work with CPU-only systems - remove --gpu option for CPU-only systems because it does not work when the option is specified --- Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index dec75e6..43da739 100755 --- a/Makefile +++ b/Makefile @@ -26,20 +26,29 @@ stop: fi warmup: - $(ELEPHANT_DOCKER) run -it --rm --gpus all $(ELEPHANT_IMAGE_NAME) echo "warming up..." + $(eval GPU_ARG:=$(shell \ + if [ -n "$(ELEPHANT_NVIDIA_GID)" ] && [ -n "$(ELEPHANT_GPU)" ]; then \ + VAR=$$(echo --gpus '"device=$(ELEPHANT_GPU)"'); \ + fi;\ + echo $$VAR)) + @if [ -n "$(GPU_ARG)" ]; then \ + $(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) $(ELEPHANT_IMAGE_NAME) echo "warming up GPU..."; \ + else \ + echo "CPU mode..."; \ + fi launch: warmup - $(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace -p 8080:80 -p 5672:5672 \ + $(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace -p 8080:80 -p 5672:5672 \ -e LOCAL_UID=$(shell id -u) -e LOCAL_GID=$(shell id -g) -e NVIDIA_GID=$(ELEPHANT_NVIDIA_GID) \ $(ELEPHANT_IMAGE_NAME) bash: warmup - $(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \ + $(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \ -e LOCAL_UID=$(shell id -u) -e LOCAL_GID=$(shell id -g) -e AS_LOCAL_USER=1 -e NVIDIA_GID=$(ELEPHANT_NVIDIA_GID) \ $(ELEPHANT_IMAGE_NAME) /bin/bash -bashroot: - $(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \ +bashroot: warmup + $(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \ $(ELEPHANT_IMAGE_NAME) /bin/bash test: From 58a002eb0d84d29ffdd2bbf7106a03a3a831886d Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Wed, 19 Oct 2022 18:36:03 +0200 Subject: [PATCH 2/2] Update version to 0.4.3 --- Dockerfile-test | 2 +- Makefile | 2 +- elephant-core/elephant/version.py | 2 +- elephant_server.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-test b/Dockerfile-test index 8488680..df5b881 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,4 +1,4 @@ -FROM elephant-server:0.4.2 +FROM elephant-server:0.4.3 LABEL maintainer="Ko Sugawara " diff --git a/Makefile b/Makefile index 43da739..892ac54 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ help: ELEPHANT_GPU?=all ELEPHANT_WORKSPACE?=${PWD}/workspace -ELEPHANT_IMAGE_NAME?=elephant-server:0.4.2 +ELEPHANT_IMAGE_NAME?=elephant-server:0.4.3 ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}') ELEPHANT_DOCKER?=docker diff --git a/elephant-core/elephant/version.py b/elephant-core/elephant/version.py index efb0489..50ecfe1 100644 --- a/elephant-core/elephant/version.py +++ b/elephant-core/elephant/version.py @@ -24,4 +24,4 @@ # ============================================================================== """Version definition.""" -__version__ = '0.4.2' +__version__ = '0.4.3' diff --git a/elephant_server.ipynb b/elephant_server.ipynb index 478c5b1..5081149 100644 --- a/elephant_server.ipynb +++ b/elephant_server.ipynb @@ -51,7 +51,7 @@ "id": "CpJPKG_ATv39" }, "source": [ - "%env ELEPHANT_SERVER_VERSION = v0.4.2" + "%env ELEPHANT_SERVER_VERSION = v0.4.3" ], "execution_count": null, "outputs": []