diff --git a/python/paddle_serving_server_gpu/__init__.py b/python/paddle_serving_server_gpu/__init__.py index 76d31dbd908b9fd1e8e2093fa33cf6f238743dd2..7ab27dc0cb71041506d715d1ab4ca58c25d2c6d9 100644 --- a/python/paddle_serving_server_gpu/__init__.py +++ b/python/paddle_serving_server_gpu/__init__.py @@ -235,15 +235,11 @@ class Server(object): self.bin_path = os.environ["SERVING_BIN"] def check_cuda(self): - cuda_flag = False - r = os.popen("ldd {} | grep cudart".format(self.bin_path)) - r = r.read().split("=") - if len(r) >= 2 and "cudart" in r[1] and os.system( - "ls /dev/ | grep nvidia > /dev/null") == 0: - cuda_flag = True - if not cuda_flag: + if os.system("ls /dev/ | grep nvidia > /dev/null") == 0: + pass + else: raise SystemExit( - "CUDA not found, please check your environment or use cpu version by \"pip install paddle_serving_server\"" + "GPU not found, please check your environment or use cpu version by \"pip install paddle_serving_server\"" ) def set_gpuid(self, gpuid=0):