1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/serverless-gpu-resources-kn.adoc
2021-06-03 14:54:06 -05:00

34 lines
1.3 KiB
Plaintext

// Module included in the following assemblies:
//
// * serverless/integrations/gpu-resources.adoc
[id="serverless-gpu-resources-kn_{context}"]
= Specifying GPU requirements for a service
After GPU resources are enabled for your {product-title} cluster, you can specify GPU requirements for a Knative service using the `kn` CLI.
[NOTE]
====
Using NVIDIA GPU resources is not supported for IBM Z and IBM Power Systems.
====
.Procedure
. Create a Knative service and set the GPU resource requirement limit to `1` by using the `--limit nvidia.com/gpu=1` flag:
+
[source,terminal]
----
$ kn service create hello --image <service-image> --limit nvidia.com/gpu=1
----
+
A GPU resource requirement limit of `1` means that the service has 1 GPU resource dedicated. Services do not share GPU resources. Any other services that require GPU resources must wait until the GPU resource is no longer in use.
+
A limit of 1 GPU also means that applications exceeding usage of 1 GPU resource are restricted. If a service requests more than 1 GPU resource, it is deployed on a node where the GPU resource requirements can be met.
. Optional. For an existing service, you can change the GPU resource requirement limit to `3` by using the `--limit nvidia.com/gpu=3` flag:
+
[source,terminal]
----
$ kn service update hello --limit nvidia.com/gpu=3
----