A Highly Reduced OmniGen Installation Experience
Entry Overview
Tonight, we completed a fresh installation of Ubuntu 24.01.1 LTS and a bare metal installation of OmniGen. It took a few tries to configure CUDA, cuDDN and a few (undocumented) dependencies correctly. At the end of the night, we had a launcher configured in Gnome, and OmniGen up and running ready for testing. This is a brief how-to guide culled from the procedures that worked. I miss my shiny Fedora desktop, but it's nice to have a well-worn OS that works (rather than mostly works and always amuses). Lord knows, I'm a sucker for [r/LinuxPorn] (https://www.reddit.com/r/LinuxPorn/), but no, I won't use Arch or Hyprland as a daily driver, btw.
Overview
This guide provides step-by-step instructions to install and run OmniGen on Ubuntu 24.04.1, ensuring NVIDIA GPU support with CUDA and PyTorch. It includes pre-installation preparation and core installation steps.
Pre-Installation Preparation
1. Verify NVIDIA Drivers
Ensure NVIDIA drivers are installed and working:
nvidia-smi
If not installed, refer to the NVIDIA driver installation guide.
2. Install CUDA Toolkit
- Confirm your installed CUDA version:
bash
nvcc --version
If CUDA is not installed, download and install it: - Visit CUDA Toolkit Downloads. - Select the correct version for Ubuntu 24.04.
- Add CUDA to your environment:
bash
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
3. Install cuDNN
- Download the compatible cuDNN version for your CUDA:
- Visit cuDNN Downloads.
-
Select the version matching your CUDA release.
-
Install the
.deb
packages:
bash
sudo dpkg -i libcudnn*.deb
- Verify the installation:
bash
dpkg -l | grep libcudnn
4. Install Python 3.10
Ubuntu 24.04 defaults to Python 3.12, so install Python 3.10:
sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-distutils
Core Installation Steps
1. Clone the OmniGen Repository
- Navigate to your desired directory:
bash
mkdir -p /home/foxxai/AI/omnigen
cd /home/foxxai/AI/omnigen
- Clone the repository:
bash
git clone https://github.com/VectorSpaceLab/OmniGen.git .
2. Set Up a Virtual Environment
- Create the virtual environment:
bash
python3.10 -m venv omnigen_env
- Activate the virtual environment:
bash
source omnigen_env/bin/activate
- Upgrade pip:
bash
pip install --upgrade pip
3. Install PyTorch
Install the PyTorch version compatible with your CUDA version (e.g., 12.4 uses CUDA 12.0 builds):
pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu120
4. Install OmniGen
- Install OmniGen in editable mode:
bash
pip install -e .
- Ensure all dependencies are installed (if
gradio
or other modules are missing):
bash
pip install gradio spaces
5. Launch OmniGen
- Run the OmniGen application:
bash
python app.py
- Open the provided URL (e.g.,
http://127.0.0.1:7860
) in your browser to access the OmniGen interface.
Troubleshooting
- Missing Dependencies: Install missing Python packages as needed.
- Model Downloads: Large pre-trained models (~15GB each) will download on the first run. Ensure sufficient disk space.
- CUDA Issues: Verify CUDA setup with:
bash
python -c "import torch; print(torch.cuda.is_available())"
Credits
- OmniGen Repository: VectorSpaceLab/OmniGen
- PyTorch Installation Guide: PyTorch.org
- NVIDIA CUDA Resources: CUDA Toolkit