Hi, when running Bentoml serve on pod I want the p...
# ask-for-help
a
Hi, when running Bentoml serve on pod I want the pod to crash if GPU is not available, i'm using the following code:
Copy code
if torch.cuda.is_available():
    return "cuda"
if torch.backends.mps.is_available():
    return "mps"
raise RuntimeError("No device available")
service itself keeps restarting. W What actually we need is the service try once and crash with sys exit 1 ( which will restart the pod )
j
did it solve your problem?
a
yes