R
RunPod5d ago
vesper

How do I calculate the cost of my last execution on a serverless GPU?

For example if I have one GPU with cost $0.00016 and the other ones with $0.00019. How do I know which serverless GPU actually picked this GPU after the request has been completed? Also, is there an easy way to just get the cost of the last runsync request instead of manually calculating it?
2 Replies
nerdylive
nerdylive5d ago
you can return your gpu type, in your handler you add some function to read from environmental variable like so: (an example) RUNPOD_GPU_NAME=NVIDIA+RTX+4000+Ada+Generation no there's no way of getting cost of a runsync request code to get the gpu model name like above:
import os

# Access the environment variable directly
gpu_name = os.environ['RUNPOD_GPU_NAME']
print(f"GPU Name: {gpu_name}")
import os

# Access the environment variable directly
gpu_name = os.environ['RUNPOD_GPU_NAME']
print(f"GPU Name: {gpu_name}")
vesper
vesperOP3d ago
Ah, thanks.

Did you find this page helpful?