Skip to content

Commit 19b7bbb

Browse files
add docs on how to check gpu type availability (#291)
Co-authored-by: Mo King <[email protected]>
1 parent cc4d51f commit 19b7bbb

File tree

1 file changed

+138
-9
lines changed

1 file changed

+138
-9
lines changed

sdks/graphql/manage-pods.mdx

Lines changed: 138 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ title: "Manage Pods"
66

77
Runpod uses API Keys for all API requests. Go to [Settings](https://www.runpod.io/console/user/settings) to manage your API keys.
88

9-
## GraphQL API Spec
9+
## GraphQL API spec
1010

11-
If you need detailed queries, mutations, fields, and inputs, look at the [GraphQL Spec](https://graphql-spec.runpod.io/).
11+
If you need detailed queries, mutations, fields, and inputs, look at the [GraphQL spec](https://graphql-spec.runpod.io/).
1212

1313
## Create Pods
1414

@@ -32,7 +32,7 @@ A Pod consists of the following resources:
3232

3333
* Global Networking
3434

35-
### Create On-Demand Pod
35+
### Create on-demand Pod
3636

3737
<Tabs>
3838
<Tab title="cURL">
@@ -101,7 +101,7 @@ mutation {
101101

102102
</Tabs>
103103

104-
### Create Spot Pod
104+
### Create spot Pod
105105

106106
<Tabs>
107107
<Tab title="cURL">
@@ -171,7 +171,7 @@ mutation {
171171

172172
</Tabs>
173173

174-
### Filter by Allowed CUDA Versions
174+
### Filter by CUDA version
175175

176176
You can pass in the `allowedCudaVersions` as a list of CUDA versions that you want to allow for the GPU in the pod.
177177

@@ -238,7 +238,7 @@ mutation {
238238

239239
## Start Pods
240240

241-
### Start On-Demand Pod
241+
### Start on-demand Pod
242242

243243
<Tabs>
244244
<Tab title="cURL">
@@ -293,7 +293,7 @@ mutation {
293293

294294
</Tabs>
295295

296-
### Start Spot Pod
296+
### Start spot Pod
297297

298298
<Tabs>
299299
<Tab title="cURL">
@@ -348,7 +348,7 @@ mutation {
348348

349349
</Tabs>
350350

351-
### Filter by CUDA Version
351+
### Filter by CUDA version
352352

353353
You can pass in the `allowedCudaVersions` as a list of CUDA versions that you want to allow for the GPU in the pod.
354354

@@ -714,7 +714,7 @@ query GpuTypes {
714714

715715
</Tabs>
716716

717-
### Get GPU Type by ID
717+
### Get GPU type by ID
718718

719719
<Tabs>
720720
<Tab title="cURL">
@@ -770,3 +770,132 @@ query GpuTypes {
770770
</Tab>
771771

772772
</Tabs>
773+
774+
### Check GPU type availability
775+
776+
You can check if a specific [GPU type](/references/gpu-types) is available in the [Secure Cloud or Community Cloud](/references/faq#secure-cloud-vs-community-cloud).
777+
778+
<Note>
779+
The `stockStatus` field can help you determine the likelihood that a particular GPU type will be available when creating a Pod. For example, if `stockStatus` is `"Low"`, it means there are very few GPUs of that type available.
780+
</Note>
781+
782+
<Tabs>
783+
<Tab title="cURL">
784+
```bash
785+
curl --request POST \
786+
--header 'content-type: application/json' \
787+
--url 'https://api.runpod.io/graphql?api_key=${YOUR_API_KEY}' \
788+
--data '{"query": "query { gpuTypes(input: { id: \"NVIDIA RTX A4000\" }) { lowestPrice(input: { compliance: null, dataCenterId: null, globalNetwork: false, gpuCount: 1, minDisk: 0, minMemoryInGb: 8, minVcpuCount: 2, secureCloud: true }) { minimumBidPrice uninterruptablePrice minVcpu minMemory stockStatus compliance maxUnreservedGpuCount availableGpuCounts __typename } id displayName memoryInGb securePrice communityPrice oneMonthPrice oneWeekPrice threeMonthPrice sixMonthPrice secureSpotPrice __typename } }"}'
789+
```
790+
</Tab>
791+
792+
<Tab title="GraphQL">
793+
```GraphQL
794+
query {
795+
gpuTypes(input: { id: "NVIDIA RTX A4000" }) {
796+
lowestPrice(input: {
797+
compliance: null,
798+
dataCenterId: null,
799+
globalNetwork: false,
800+
gpuCount: 1,
801+
minDisk: 0,
802+
minMemoryInGb: 8,
803+
minVcpuCount: 2,
804+
secureCloud: true
805+
}) {
806+
minimumBidPrice
807+
uninterruptablePrice
808+
minVcpu
809+
minMemory
810+
stockStatus
811+
compliance
812+
maxUnreservedGpuCount
813+
availableGpuCounts
814+
__typename
815+
}
816+
id
817+
displayName
818+
memoryInGb
819+
securePrice
820+
communityPrice
821+
oneMonthPrice
822+
oneWeekPrice
823+
threeMonthPrice
824+
sixMonthPrice
825+
secureSpotPrice
826+
__typename
827+
}
828+
}
829+
```
830+
</Tab>
831+
832+
<Tab title="Example output (in stock)">
833+
```json
834+
{
835+
"data": {
836+
"gpuTypes": [
837+
{
838+
"lowestPrice": {
839+
"minimumBidPrice": 0.2,
840+
"uninterruptablePrice": 0.35,
841+
"minVcpu": 2,
842+
"minMemory": 8,
843+
"stockStatus": "IN_STOCK",
844+
"compliance": null,
845+
"maxUnreservedGpuCount": 5,
846+
"availableGpuCounts": [1, 2, 4],
847+
"__typename": "GpuTypeLowestPrice"
848+
},
849+
"id": "NVIDIA RTX A4000",
850+
"displayName": "RTX A4000",
851+
"memoryInGb": 16,
852+
"securePrice": 0.35,
853+
"communityPrice": 0.2,
854+
"oneMonthPrice": 200,
855+
"oneWeekPrice": 60,
856+
"threeMonthPrice": 500,
857+
"sixMonthPrice": 900,
858+
"secureSpotPrice": 0.18,
859+
"__typename": "GpuType"
860+
}
861+
]
862+
}
863+
}
864+
```
865+
</Tab>
866+
867+
<Tab title="Example output (low stock)">
868+
```json
869+
{
870+
"data": {
871+
"gpuTypes": [
872+
{
873+
"lowestPrice": {
874+
"minimumBidPrice": 0.16,
875+
"uninterruptablePrice": 0.24,
876+
"minVcpu": 5,
877+
"minMemory": 31,
878+
"stockStatus": "Low",
879+
"compliance": null,
880+
"maxUnreservedGpuCount": 7,
881+
"availableGpuCounts": [1,2,3,4,5,6,7],
882+
"__typename": "LowestPrice"
883+
},
884+
"id": "NVIDIA RTX A4000",
885+
"displayName": "RTX A4000",
886+
"memoryInGb": 16,
887+
"securePrice": 0.24,
888+
"communityPrice": 0.17,
889+
"oneMonthPrice": null,
890+
"oneWeekPrice": null,
891+
"threeMonthPrice": 0.204,
892+
"sixMonthPrice": 0.192,
893+
"secureSpotPrice": 0.16,
894+
"__typename": "GpuType"
895+
}
896+
]
897+
}
898+
}
899+
```
900+
</Tab>
901+
</Tabs>

0 commit comments

Comments
 (0)