Verify GPU configuration with an AI inference server
Deploy a Red Hat AI inference server instance to verify that your GPU passthrough configuration works correctly.
Prepare a RHEL image for GPU instances Copy linkLink copied!
Prepare a RHEL-based image in the Image service (glance) for launching GPU-enabled instances. This image provides the base operating system for deploying AI workloads.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Ensure that the image is uploaded. The status should initially show "importing" and then change to "active" when the upload is complete.
$ watch openstack image show -c status -f value <rhel9.x>- Replace <rhel9.x> with the name and version number of your downloaded image.
Launch a GPU-enabled instance Copy linkLink copied!
Launch a GPU-enabled instance and deploy the Red Hat AI inference server. This deployment verifies that your instances can access GPU hardware and demonstrates a working AI inference service.
Before you begin Copy linkLink copied!
- You have created an Image service (glance) image for the GPU workload.
- A flavor is available to you for creating instances for GPU workloads.
- An appropriate security group with SSH access is provisioned for you to use.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Check that the GPU device is available inside the RHEL instance:
- NVIDIA
nvidia-smi -L- AMD
/opt/rocm/bin/rocm-smiExample output
GPU 0: NVIDIA A100-PCIE-40GB (UUID: GPU-4b9f8464-ad90-cdde-8510-8006fc2772b7) GPU 1: NVIDIA A100-PCIE-40GB (UUID: GPU-7a2e3526-44f0-4d2f-7283-6114a8b82a32)
- Make a request to your model using the API:
$ curl -X POST -H "Content-Type: application/json" -d '{ "prompt": "What is the capital of France?", "max_tokens": 50 }' http://<floating_ip>:8000/v1/completions | jq- Replace
<floating_ip>with the address of your instance that you retrieved in a previous step.Example output
{ "id": "cmpl-b84aeda1d5a4485c9cb9ed4a13072fca", "object": "text_completion", "created": 1746555421, "model": "RedHatAI/Llama-3.2-1B-Instruct-FP8", "choices": [ { "index": 0, "text": " Paris.\nThe capital of France is Paris.", "logprobs": null, "finish_reason": "stop", "stop_reason": null, "prompt_logprobs": null } ], "usage": { "prompt_tokens": 8, "total_tokens": 18, "completion_tokens": 10, "prompt_tokens_details": null }
- Replace