How To Create a GPU Container
Create and configure a GPU container using the CosmicAC CLI.
Prefer the web interface? See Getting Started: GPU Container Job for GUI instructions.
Prerequisites
- CosmicAC account
- CosmicAC CLI installed (see Installation guide)
Log in (Optional)
If not already authenticated:
npx cosmicac loginThis opens your browser for authentication. If the browser doesn't open automatically, copy the URL from the terminal and paste it into your browser. Complete the login to continue.
Initialize the job configuration
Run the interactive setup to create a job.config.json file:
npx cosmicac jobs initFollow the prompts to configure your job:
- Project name — A descriptive name for your job
- Tags — Comma-separated labels to organize your job
- Type — Select
GPU_CONTAINER - GPU type — Hardware configuration
- GPU count — Number of GPUs to allocate
- Country code — Region where your container runs (e.g.,
US,IN) - Container image — Base image (e.g.,
ubuntu:24.04) - Cost limit — Maximum spend threshold (USD)
- Alerts — Notifications to enable (e.g., Cost Exceeded, Errors)
To create the config in a specific directory:
npx cosmicac jobs init --dir ./my-projectReview the configuration
The generated job.config.json contains your job settings:
{
"name": "train-image-model",
"type": "GPU_CONTAINER",
"tags": [
"training",
"image-recognition"
],
"gpu": {
"type": "GH100_H100_SXM5_80GB",
"count": 4
},
"location": "IN",
"params": {
"cpu_limit": "4",
"memory_limit": "8Gi",
"cpu_request": "2",
"memory_request": "4Gi"
}
}Adjust settings as needed. See GPU Types for available hardware options.
Create the container
npx cosmicac jobs createVerify the job was created
npx cosmicac jobs listYour container is ready when the status shows Running.
What's next?
- How to Access a GPU Container — Connect to your container and open a shell session.
- GPU Types — View available GPU options for your configuration.
- CLI Commands — Full command reference with output examples.