Skip to content

cog run does not work with A100 #389

Description

@mitchellgordon95

Trying to do inference on a machine with an A100 GPU. Here's my cog file:

image: "myimage"
build:
  gpu: true
  python_version: "3.8"
  cuda: "11.3"
  python_packages:
    - "transformers==4.15.0"
    - "torch==1.10.1"
    - "ray[serve]==1.5.0"
    - "kfserving==0.6.1"

When I do sudo cog run python model.py I get the following error:

/root/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/cuda/__init__.py:106: UserWarning:
NVIDIA A100-PCIE-40GB with CUDA capability sm_80 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA A100-PCIE-40GB GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
> /src/model.py(24)predict()
-> output_ids = self.model.generate(input_ids.cuda())

So apparently my CUDA installation is missing some capabilities. Looking at stack overflow, it seems like doing

pip3 install torch==1.10.1+cu113 -f https://download.pytorch.org/whl/cpu/torch_stable.html

might fix that problem? But I can't pin 1.10.1+cu113 since cog doesn't allow us to specify custom pip archives via pip -f

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions