Skip to content

Commit

Permalink
CTX-6655: Other discussion changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Tintor committed Aug 27, 2024
1 parent e63414a commit 15592b9
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions coretex/cli/modules/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,33 +399,32 @@ def configureNode(advanced: bool) -> NodeConfiguration:
else:
nodeConfig.allowGpu = False

if nodeConfig.allowGpu and platform.system().lower() == "linux":
if not docker.isDaemonFileUpdated():
shouldUpdateDockerConfig = ui.clickPrompt(
"NVIDIA has a bug where a docker container running Coretex Node can lose access to GPU "
"(https://github.com/NVIDIA/nvidia-container-toolkit/issues/48). "
"\nDo you want Coretex CLI to apply a workaround for this bug "
"(NOTE: This requires docker daemon restart)? (Y/n)",
type = bool,
default = True
)
if nodeConfig.allowGpu and platform.system().lower() == "linux" and not docker.isDaemonFileUpdated():
shouldUpdateDockerConfig = ui.clickPrompt(
"NVIDIA has a bug where a docker container running Coretex Node can lose access to GPU "
"(https://github.com/NVIDIA/nvidia-container-toolkit/issues/48). "
"\nDo you want Coretex CLI to apply a workaround for this bug "
"(NOTE: This requires docker daemon restart)? (Y/n)",
type = bool,
default = True
)

if shouldUpdateDockerConfig:
docker.updateDaemonFile()
restartPrompt = ui.clickPrompt("Do you want to restart Docker to apply the changes? (Y/n)", type = bool, default = True)

if restartPrompt:
docker.restartDocker()
else:
ui.warningEcho(
"Warning: The changes will not take effect until Docker is restarted. "
"(https://github.com/NVIDIA/nvidia-container-toolkit/issues/48)"
)
if shouldUpdateDockerConfig:
docker.updateDaemonFile()
shouldRestartDocker = ui.clickPrompt("Do you want to restart Docker to apply the changes? (Y/n)", type = bool, default = True)

if shouldRestartDocker:
docker.restartDocker()
else:
ui.warningEcho(
"Warning: Not updating the daemon.json file may lead to GPU access issues in Docker "
"containers. (https://github.com/NVIDIA/nvidia-container-toolkit/issues/48)"
"Warning: The changes will not take effect until Docker is restarted. "
"(https://github.com/NVIDIA/nvidia-container-toolkit/issues/48)"
)
else:
ui.warningEcho(
"Warning: Not updating the daemon.json file may lead to GPU access issues in Docker "
"containers. (https://github.com/NVIDIA/nvidia-container-toolkit/issues/48)"
)

if imageType == ImageType.official:
tag = "gpu" if nodeConfig.allowGpu else "cpu"
Expand Down

0 comments on commit 15592b9

Please sign in to comment.