6.2. Configuring the GPU that you want to use with the command-line assistant


For better performance, you can change the configuration settings of the graphics processing unit (GPU) attached to the host system by editing the ~/.config/rhel-lightspeed/.env file. This file contains information to help you select the correct container image and device settings for your hardware.

Prerequisites

Procedure

  1. Open the ~/.config/rhel-lightspeed/.env file in a text editor. For example:

    $ vi ~/.config/rhel-lightspeed/.env
  2. Set the container image variable:

    1. Locate the LLAMACPP_IMAGE variable and set it up to the corresponding ramalama container for your GPU hardware. For example:

      LLAMACPP_IMAGE="registry.redhat.io/rhel-cla/ramalama-rhel10-nvidia:latest"
  3. Set the host device variable:

    1. Locate the HOST_DEVICE variable for the device of your GPU. For example:

      # For AMD GPUs
      HOST_DEVICE="/dev/dri"
      # For NVIDIA GPUs
      HOST_DEVICE="/dev/nvidia0"
  4. Optional: Configure NVIDIA-specific variables:

    1. Locate and set up the NVIDIA-specific variables.
  5. Restart the assistant to apply the changes:

    $ rhel-lightspeed stop
    $ rhel-lightspeed start

Troubleshooting

  • Resolve GPU errors after restarting an EC2 instance.

    When you use the offline RHEL command-line assistant on a GPU-enabled AWS EC2 instance, the rhel-lightspeed start command might fail after the instance is stopped and restarted. This error happens because the GPU ID changes after a restart. To work around this problem, regenerate the NVIDIA Container Device Interface (CDI) configuration file by running the following command:

    $ nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml

    This updates the reference of the system to the GPU, enabling the rhel-lightspeed service to start correctly.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部