Logo

dev-resources.site

for different kinds of informations.

Running Nvidia COSMOS on A100 80Gb

Published at
1/13/2025
Categories
nvidia
cuda
ai
text2video
Author
felipelujan
Categories
4 categories in total
nvidia
open
cuda
open
ai
open
text2video
open
Author
11 person written this
felipelujan
open
Running Nvidia COSMOS on A100 80Gb

Video Example
https://youtube.com/shorts/9dOihUzSSho

How to run Nvidia Cosmos on Ubuntu 22.04

In this tutorial, you'll learn how to quickly set up Ubuntu 22.04 to run Nvidia Cosmos. This involves installing the necessary drivers, Docker, and CUDA dependencies.

Thanks to the Google Developers Experts program for providing the infra for this experiment ๐Ÿงช

Prequisites

  1. Ubuntu 22.04 doh.
  2. A beefy Nvidia GPU. 30Gb+ of VRAM. Either Blackwell, Hopper, or Ampere.
  3. 200Gb+ of local storage.

Step1: Run Script 1

curl -o- https://raw.githubusercontent.com/FelipeLujan/GCPexperiments/refs/heads/master/NvidiaCosmos/prepare_ubuntu%20_part1.sh | bash
Enter fullscreen mode Exit fullscreen mode

Script 1 updates Ubuntu, installs Nvidia drivers, and reboots to finalize changes.

Script 2

Run once your is back up.

curl -o- https://raw.githubusercontent.com/FelipeLujan/GCPexperiments/refs/heads/master/NvidiaCosmos/prepare_ubuntu_part2.sh | bash
Enter fullscreen mode Exit fullscreen mode

Script 2 installs Docker, configures the Nvidia toolkit, then clones and builds the Cosmos repository.

If you see something like this at the end of Script 2, congratulations, your docker container is almost ready to run Cosmos.

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.216.03             Driver Version: 535.216.03   CUDA Version: 12.6     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A100-SXM4-80GB          Off | 00000000:00:05.0 Off |                    0 |
| N/A   32C    P0              57W / 400W |      0MiB / 81920MiB |     24%      Default |
|                                         |                      |             Disabled |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
Enter fullscreen mode Exit fullscreen mode

Downloading cosmos models in Docker Container.

At this point, your command line is attached to the costmos_container docker, run huggingface-cli login and insert your Hugging Face Token.

Generate it here https://huggingface.co/settings/tokens you only need to Check grant Read access to contents of all public gated repos you can access

Download only the 7B Text2Video model by running this command.

PYTHONPATH=$(pwd) python cosmos1/scripts/download_diffusion.py --model_sizes 7B 14B --model_types Text2World Video2World
Enter fullscreen mode Exit fullscreen mode

This download is over 50Gb. Give it a few minutes.

Generate a video from a text prompt.

PROMPT="A sleek, humanoid robot stands in a vast warehouse filled with neatly stacked cardboard boxes on industrial shelves. \
The robot's metallic body gleams under the bright, even lighting, highlighting its futuristic design and intricate joints. \
A glowing blue light emanates from its chest, adding a touch of advanced technology. The background is dominated by rows of boxes, \
suggesting a highly organized storage system. The floor is lined with wooden pallets, enhancing the industrial setting. \
The camera remains static, capturing the robot's poised stance amidst the orderly environment, with a shallow depth of \
field that keeps the focus on the robot while subtly blurring the background for a cinematic effect."

# Example using 7B model
PYTHONPATH=$(pwd) python cosmos1/models/diffusion/inference/text2world.py \
    --checkpoint_dir checkpoints \
    --diffusion_transformer_dir Cosmos-1.0-Diffusion-7B-Text2World \
    --prompt "$PROMPT" \
    --offload_prompt_upsampler \
    --video_save_name Cosmos-1.0-Diffusion-7B-Text2World

Enter fullscreen mode Exit fullscreen mode
cuda Article's
30 articles in total
Favicon
Coalesced Memory Access in CUDA for High-Performance Computing
Favicon
Accelerating Data Processing with Grid Stride Loops in CUDA
Favicon
Running Nvidia COSMOS on A100 80Gb
Favicon
Accelerating Python with Numba - Introduction to GPU Programming
Favicon
OpenMP Data-Sharing Clauses: Differences Explained
Favicon
Global vs Static in C++
Favicon
"Learn HPC with me"ย kickoff
Favicon
Snooping on your GPU: Using eBPF to Build Zero-instrumentation CUDA Monitoring
Favicon
Qt error when opening ncu-ui
Favicon
Cuda help
Favicon
Using Polars/Tensorflow with NVIDIA GPU (CUDA), on Windows using WSL2
Favicon
Lattice Generation using GPU computing in realtime
Favicon
Tensorman: TensorFlow with CUDA made easy
Favicon
Simplifying PyTorch Installation: Introducing Install.PyTorch
Favicon
Setup Nx lib and EXLA to run NX/AXON with CUDA
Favicon
NVIDIA GPU & CUDA
Favicon
Deep Learning with โ€œAWS Graviton2 + NVIDIA Tensor T4Gโ€ for as low as free* with CUDA 12.2
Favicon
My Experience Running HeadJobs: Generative AI at Home
Favicon
Why Your AWS Deep Learning AMI is Holding You Back and How toย Fix
Favicon
NVIDIA's $200B Overnight Gain: Trending CUDA Repos Revealed! โšก๏ธ
Favicon
Trending CUDA repos of the week ๐Ÿ“ˆ
Favicon
Cheapest CUDA-Compatible Cloud GPU Options in 2023
Favicon
Dockerize CUDA-Accelerated Applications
Favicon
nVidia 525 + Cuda 11.8 + Python 3.10 + pyTorch GPU Docker image
Favicon
How to use GPU for Deep Learning
Favicon
Install NVIDIA CUDA on Linux
Favicon
Import error: cannot open shared object file:no such file or directory
Favicon
[BTY] Day 1: Install NVIDA Driver, CUDA, and CUDNN on Ubuntu 20.04
Favicon
Training ESRGAN: Seemingly impossible
Favicon
GPGPU-sim Day 1

Featured ones: