### Check Python and Pip Installation Source: https://build.nvidia.com/spark/llama-factory Verify the installation of Python 3 with venv and pip. ```bash python3 --version && pip3 --version ``` -------------------------------- ### Verify Docker Installation Source: https://build.nvidia.com/spark/cutile-kernels Run this command to check if Docker is installed and accessible. ```bash docker ps ``` -------------------------------- ### Install PyTorch with CUDA 13 Source: https://build.nvidia.com/spark/llama-factory Install PyTorch with CUDA 13 support using pip. This is essential for GPU acceleration. ```bash pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130 ``` -------------------------------- ### Install PyTorch with CUDA Support Source: https://build.nvidia.com/spark/comfy-ui/instructions Install PyTorch with CUDA 13.0 support. This installation targets CUDA 13.0 compatibility with Blackwell architecture GPUs. ```bash pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130 ``` -------------------------------- ### Check Python Version Source: https://build.nvidia.com/spark/comfy-ui/overview Verify that Python 3.8 or higher is installed. This is a prerequisite for ComfyUI. ```bash python3 --version ``` -------------------------------- ### Verify System Prerequisites Source: https://build.nvidia.com/spark/comfy-ui/instructions Check that your NVIDIA DGX Spark device meets the requirements before proceeding with installation. Expected output should show Python 3.8+, pip available, CUDA toolkit, and GPU detection. ```bash python3 --version pip3 --version nvcc --version nvidia-smi ``` -------------------------------- ### Launch ComfyUI Server Source: https://build.nvidia.com/spark/comfy-ui/instructions Starts the ComfyUI web server, making it accessible from any network interface. The server defaults to port 8188. ```bash python main.py --listen 0.0.0.0 ``` -------------------------------- ### Install ComfyUI Dependencies Source: https://build.nvidia.com/spark/comfy-ui/instructions Install the required Python packages for ComfyUI operation. This installs all necessary dependencies including web interface components and model handling libraries. ```bash pip install -r requirements.txt ``` -------------------------------- ### Check CUDA Toolkit Version Source: https://build.nvidia.com/spark/comfy-ui/overview Verify the CUDA toolkit version compatible with Blackwell is installed. This is essential for GPU acceleration. ```bash nvcc --version ``` -------------------------------- ### Check Git Version Source: https://build.nvidia.com/spark/comfy-ui/overview Confirm that Git version control is installed. This is required for managing project files and dependencies. ```bash git --version ``` -------------------------------- ### Check pip Version Source: https://build.nvidia.com/spark/comfy-ui/overview Ensure the pip package manager is available. This is needed for installing Python dependencies. ```bash pip3 --version ``` -------------------------------- ### Validate ComfyUI Installation Source: https://build.nvidia.com/spark/comfy-ui/instructions Checks if the ComfyUI web server is running by sending an HTTP HEAD request. Expect a 200 OK response. ```bash curl -I http://localhost:8188 ``` -------------------------------- ### Benchmark Qwen2-7B Model Source: https://build.nvidia.com/spark/cutile-kernels This script is specifically for benchmarking the Qwen2-7B model. It requires the model to be present or accessible. ```bash #!/bin/bash # Benchmark Qwen2-7B model ./bench_qwen.sh ``` -------------------------------- ### FMHA Step-by-Step Optimization Tutorial Source: https://build.nvidia.com/spark/cutile-kernels This Python script provides a tutorial on optimizing Flash Multi-Head Attention (FMHA) step-by-step. It is useful for understanding and applying FMHA optimizations. ```python #!/usr/bin/env python # FMHA step-by-step optimization tutorial python fmha_optimization_tutorial.py ``` -------------------------------- ### Verify System Components with Bash Source: https://build.nvidia.com/spark/nemoclaw Run this bash script to verify your system's OS version, NVIDIA GPU driver, and Docker server version. Ensure you have Ubuntu 24.04, an NVIDIA GB10 GPU, and Docker 28.x+. ```bash head -n 2 /etc/os-release nvidia-smi docker info --format '{{.ServerVersion}}' ``` -------------------------------- ### Cleanup ComfyUI Installation Source: https://build.nvidia.com/spark/comfy-ui/instructions Removes the ComfyUI virtual environment and its directory. This is a complete uninstallation. ```bash deactivate rm -rf comfyui-env/ rm -rf ComfyUI/ ``` -------------------------------- ### Run All Kernel Benchmarks Source: https://build.nvidia.com/spark/cutile-kernels This script executes all available kernel benchmarks. Ensure you are in the correct directory before running. ```bash #!/bin/bash # Run all kernel benchmarks ./run_all.sh ``` -------------------------------- ### Download Stable Diffusion Checkpoint Source: https://build.nvidia.com/spark/comfy-ui/instructions Downloads the Stable Diffusion 1.5 model to the checkpoints directory. Ensure you are in the correct directory before running. ```bash cd models/checkpoints/ wget https://huggingface.co/Comfy-Org/stable-diffusion-v1-5-archive/resolve/main/v1-5-pruned-emaonly-fp16.safetensors cd ../../ ``` -------------------------------- ### Check Docker GPU Integration Source: https://build.nvidia.com/spark/multi-modal-inference Run this command to verify that Docker can access and utilize the GPUs on your system. It launches a PyTorch container and runs `nvidia-smi` within it. ```bash docker run --rm --gpus all nvcr.io/nvidia/pytorch:25.11-py3 nvidia-smi ``` -------------------------------- ### Verify GPU Access Source: https://build.nvidia.com/spark/multi-modal-inference Use `nvidia-smi` to verify that your system recognizes the GPU and its status. This is a fundamental check before proceeding with GPU-accelerated tasks. ```bash nvidia-smi ``` -------------------------------- ### Main Inference Script with TileGym Integration Source: https://build.nvidia.com/spark/cutile-kernels This Python script serves as the main entry point for inference tasks and integrates with TileGym for optimized operations. ```python #!/usr/bin/env python # Main inference script with TileGym integration python infer.py ``` -------------------------------- ### Benchmark DeepSeek-V2-Lite Model Source: https://build.nvidia.com/spark/cutile-kernels This script is used to benchmark the DeepSeek-V2-Lite model. Ensure all dependencies are met before execution. ```bash #!/bin/bash # Benchmark DeepSeek-V2-Lite model ./bench_deepseek.sh ``` -------------------------------- ### Create Python Virtual Environment Source: https://build.nvidia.com/spark/comfy-ui/instructions Create an isolated Python virtual environment to avoid conflicts with system packages. Verify the virtual environment is active by checking the command prompt shows (comfyui-env). ```bash python3 -m venv comfyui-env source comfyui-env/bin/activate ``` -------------------------------- ### Clone ComfyUI Repository Source: https://build.nvidia.com/spark/comfy-ui/instructions Download the ComfyUI source code from the official repository. ```bash git clone https://github.com/comfyanonymous/ComfyUI.git cd ComfyUI/ ```