## TL;DR

TensorRT-LLM custom image failing on Modal: pass the gpu argument to run_function (and pip_install), not to from_image(). In your code:.run_function(hello_world, secrets=[Secret.from_name("your-huggingface-secret")], gpu=GPU_CONFIG).

## Steps

1. TensorRT-LLM custom image failing on Modal: pass the gpu argument to run_function (and pip_install), not to from_image(). In your code: .run_function(hello_world, secrets=[Secret.from_name("your-huggingface-secret")], gpu=GPU_CONFIG). The gpu kwarg belongs on the function call that executes, not on the image builder.

## When to use

You are seeing this: Issue modal-labs/modal-client#1318 (closed, 6 comments): ### Steps to reproduce Here are the steps to reproduce the TensorRT 1. Use this skill when you run into "TensorRT LLM is not working".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://hub.docker.com/layers/anindyadeep/tensorrt_llm/release/images/sha256-42aaa553a695223a466ad8ce74b3cbb79cdfe5bb8f54090fc445412fbfbab796?context=repo

- https://github.com/modal-labs/modal-client/issues/1318
