JetBrains CodeCanvas 2024.2 Help

Add GPU Support

If you want developers to use GPU resources in dev environments, you need to add GPU support to the corresponding computing platform and use it in an instance type. All dev environments based on a template with this instance type will have access to GPU resources.

Important: We've tested GPU support in CodeCanvas exclusively with NVIDIA GPUs, so we don't provide instructions for other GPU vendors. However, GPU support for other vendors can be added in a similar way.

  1. Follow the instructions of your cloud provider to add GPU support to the Kubernetes cluster that runs dev environments (computing platform in terms of CodeCanvas). Typically, this includes adding a GPU node pool to the cluster and installing the GPU drivers to the nodes.

  2. To make GPU resources available in dev environments, corresponding worker containers must have NVIDIA Container Toolkit installed. You can do this by creating a custom Docker image for worker containers. The image must be based on the CodeCanvas worker image and include the NVIDIA Container Toolkit installation. Here is an example of a Dockerfile:

    FROM public.registry.jetbrains.space/p/codecanvas/releases/codecanvas-worker-k8s:2024.2 # Install NVIDIA Container Toolkit using the official instructions # [[[https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html|https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html]]]
  3. Create a Docker image from the Dockerfile and push it to your Docker registry. Say, you've pushed the image to my-registry.com/my-worker-image:latest.

  4. In CodeCanvas, open the Administration | Instance Types page.

  5. Create a new instance type that will have access to GPU resources. When creating the instance type, ensure to specify the following:

    • Computing platform – the platform where you've added GPU support.

    • Pod template YAML (a template for worker pods) – specify GPU resources and the custom Docker image with NVIDIA Container Toolkit. For example, to enable one GPU for each worker pod:

      apiVersion: v1 kind: Pod spec: containers: - name: worker-main image: my-registry.com/my-worker-image:latest resources: limits: nvidia.com/gpu: 1 env: - name: WORKER_STEP_CONTAINER_GPUSETTINGS_ENABLED value: true

    After you create the instance type, CodeCanvas users will be able to select it when creating dev environment templates. All dev environments based on these templates will have access to GPU resources.

Last modified: 17 September 2024