GPU Model

Overview

You can configure GPU model selection as a customizable option for SolusVM products in WHMCS. This allows customers to choose a passthrough GPU when they order a virtual server. SolusVM assigns a free GPU of the selected model to the new server.

The GPU Model option works together with the GPU option. WHMCS only displays the GPU Model list when the customer selects the passthrough value in the GPU option. For more information, see GPU.

Important:

SolusVM does not support changing a server’s GPU through WHMCS. Customers can only select a GPU model when they order the server for the first time. To change a server’s GPU, detach the current GPU and attach a different one. For steps, see our GPU Passthrough documentation.

Prerequisites

Before you configure a GPU Model configurable option, make certain that:

  • You use version 1.0.69 or higher of the SolusVM 2 module.
  • You use a KVM plan. GPUs are not available for VZ plans.
  • You have configured at least one GPU for passthrough on a GPU-equipped compute resource.
  • You have created the GPU configurable option in the same configurable options group.

For steps to configure GPUs for passthrough and create a plan that offers a GPU model, see GPU Passthrough.

Create a GPU Model configurable option

To create the GPU Model option:

  1. Log in to the WHMCS Admin Area.

  2. Go to Configuration > System Settings > Configurable Options.

  3. Select the group that contains the GPU option.

  4. Click Add New Configurable Option.

  5. Enter GPU Model as the option name and select Dropdown as the option type.

  6. Run the following command on the management node to retrieve the GPU model IDs:

    docker exec -it $(docker ps -q -f name=solus_postgres | head -n1) psql -U$(docker exec $(docker ps -q -f name=solus_postgres | head -n1) env | grep POSTGRES_USER | awk -F "=" {'print $2'}) $(docker exec $(docker ps -q -f name=solus_postgres | head -n1) env | grep POSTGRES_DB | awk -F "=" {'print $2'}) -c 'SELECT gm.id, gm.name, COUNT(DISTINCT g.compute_resource_id) AS connected_crs_count FROM gpu_models gm LEFT JOIN gpus g ON g.gpu_model_id = gm.id AND g.allocation_mode = '"'"'passthrough'"'"' GROUP BY gm.id ORDER BY gm.name;'

    The output lists each model’s ID and name. It also lists how many compute resources currently have a GPU of that model in passthrough mode:

     id |         name          | connected_crs_count
    ----+-----------------------+---------------------
      3 | NVIDIA L4             |                   1
      7 | NVIDIA A100 80GB PCIe |                   0

    Record the id and name values for the models that you want to offer.

  7. Enter 0|None as the first option value in the Add Option text box and click Save Changes.

  8. Enter each remaining option value as GPU_MODEL_ID|DISPLAY_NAME and click Save Changes after each one, where:

    • GPU_MODEL_ID — The id value from the command output.
    • DISPLAY_NAME — The label that displays to customers.

    For example:

    0|None
    3|NVIDIA L4
    7|NVIDIA A100 80GB PCIe
  9. Click Close Window.

Important:

You must add the 0|None value as the first value in both the GPU Model and vGPU Profile options. When a customer changes the GPU option, WHMCS resets the list that no longer applies to its first value and hides it. If a GPU occupies the first position instead, WHMCS charges the customer for a GPU that they did not order.