import subprocess import logging import sys import os def run(cmd): result = subprocess.run(cmd, shell=True, capture_output=True, env=None) if result.returncode != 0: logging.error( f"Command '{cmd}' failed with exit status code '{result.returncode}'. Exiting..." ) sys.exit() return result os.chdir(os.path.abspath(os.path.dirname(__file__))) run('export LD_LIBRARY_PATH="/usr/lib/wsl/lib/"') run('export NUMBA_CUDA_DRIVER="/usr/lib/wsl/lib/libcuda.so.1"') run('python ./app2.py')