From 72be1396d992d0646fda3dc8b3bb5a2184937e62 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Tue, 8 Oct 2024 23:02:27 +0800 Subject: [PATCH] fix: jupyter restart error --- python/jittor_utils/install_cuda.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/jittor_utils/install_cuda.py b/python/jittor_utils/install_cuda.py index 0d4cb8d8..6944e395 100644 --- a/python/jittor_utils/install_cuda.py +++ b/python/jittor_utils/install_cuda.py @@ -78,8 +78,11 @@ def check_cuda_env(): with open("/proc/self/cmdline", "r") as f: argv = f.read().split("\x00") if len(argv[-1]) == 0: del argv[-1] - LOG.i(f"restart {sys.executable} {argv[1:]}") - os.execl(sys.executable, sys.executable, *argv[1:]) + if 'ipykernel_launcher' in argv: + LOG.i(f"needed restart but not {sys.executable} {argv[1:]}, you can ignore this warning.") + else: + LOG.i(f"restart {sys.executable} {argv[1:]}") + os.execl(sys.executable, sys.executable, *argv[1:]) except: pass