|
| 1 | +# Building NVIDIA blueprint on OCI: Digital twins for fluid simulation |
| 2 | + |
| 3 | +This tutorial explains how to run the NVIDIA Omniverse Digital Twins for Fluid Simulation blueprint on OCI. This example shows how to study the aerodynamics (drag, down force, etc.) of a car using a virtual wind tunnel. |
| 4 | + |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +To run this blueprint, you will need: |
| 9 | +- an OCI tenancy with limits to use a BM.GPU.L40S-NC.4 shape |
| 10 | +- an NVIDIA account for the NGC Catalog |
| 11 | +- an NGC API key to download images from the NGC catalog |
| 12 | + |
| 13 | + |
| 14 | +## Instance configuration |
| 15 | + |
| 16 | +In the OCI Console, create an instance using the BM.GPU.L40S-NC.4 shape (bare metal server with 4 x NVIDIA L40S GPU) and a native Canonical Ubuntu 22.04 image. NVIDIA drivers will be installed afterwards. |
| 17 | + |
| 18 | + |
| 19 | +### Installing NVIDIA drivers |
| 20 | + |
| 21 | +When the instance is up, a specific version NVIDIA drivers can be installed. but beforehands, we must install additional packages toi build them: |
| 22 | +``` |
| 23 | +sudo apt install -y build-essential |
| 24 | +``` |
| 25 | +Then we can download the NVIDIA driver version 535.161.07 available [here](https://www.nvidia.com/fr-fr/drivers/details/220428/) and install it. |
| 26 | +``` |
| 27 | +wget https://fr.download.nvidia.com/XFree86/Linux-x86_64/535.161.07/NVIDIA-Linux-x86_64-535.161.07.run |
| 28 | +chmod +x NVIDIA-Linux-x86_64-535.161.07.run |
| 29 | +sudo ./NVIDIA-Linux-x86_64-535.161.07.run |
| 30 | +``` |
| 31 | +The instance must be rebooted for the changes to be taken into account. |
| 32 | +``` |
| 33 | +sudo reboot |
| 34 | +``` |
| 35 | + |
| 36 | + |
| 37 | +### Installing additional packages |
| 38 | + |
| 39 | +As this is a native Ubuntu version, a few additional packages must be installed to clone the repo and add and configure docker. |
| 40 | +``` |
| 41 | +sudo apt install -y git-lfs |
| 42 | +sudo apt install -y docker.io |
| 43 | +sudo apt install -y docker-compose-v2 |
| 44 | +sudo apt install -y docker-buildx |
| 45 | +``` |
| 46 | + |
| 47 | +### Installing and configuring NVIDIA Container Toolkit |
| 48 | + |
| 49 | +First of all, we must add the NVIDIA Container Toolkit repository to the repository list: |
| 50 | +``` |
| 51 | +curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ |
| 52 | + && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ |
| 53 | + sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ |
| 54 | + sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list |
| 55 | +``` |
| 56 | +Then, we can update the list of packages from all repositories, install the `nvidia-container-toolkit` package and configure docker. |
| 57 | +``` |
| 58 | +sudo apt update |
| 59 | +sudo apt install -y nvidia-container-toolkit |
| 60 | +sudo nvidia-ctk runtime configure --runtime=docker |
| 61 | +sudo systemctl restart docker |
| 62 | +``` |
| 63 | + |
| 64 | +## Downloading and building the project |
| 65 | + |
| 66 | +At this stage it is necessary to set you NGC API key as an environment variable to be able to download the right content from the NGC Catalog. |
| 67 | +``` |
| 68 | +echo "export NGC_API_KEY=nvapi-xxx" >> ~/.bashrc |
| 69 | +source ~/.bashrc |
| 70 | +``` |
| 71 | +where `nvapi-xxx` is your own NGC API key. |
| 72 | + |
| 73 | +Once done, we can clone the repository and build the images: |
| 74 | +``` |
| 75 | +git clone ssh://github.com/NVIDIA-Omniverse-Blueprints/digital-twins-for-fluid-simulation $HOME/digital_twins_for_fluid_simulation |
| 76 | +cd $HOME/digital_twins_for_fluid_simulation |
| 77 | +./build-docker.sh |
| 78 | +``` |
| 79 | +Now 2 files have to be modified, namely `.env` and `compose.yml`. |
| 80 | + |
| 81 | +First, create a copy of the environment file template: |
| 82 | +``` |
| 83 | +cp .env_template .env |
| 84 | +``` |
| 85 | +and set the `ZMQ_IP` with the instance private IP address. |
| 86 | +``` |
| 87 | +ZMQ_IP=XXX.XXX.XXX.XXX |
| 88 | +``` |
| 89 | + |
| 90 | +Then, modify `compose.yml` file. |
| 91 | +1. In the `kit` section, replace the `network_mode: host` line by the following block: |
| 92 | +``` |
| 93 | +networks: |
| 94 | + outside: |
| 95 | + ipv4_address: XXX.XXX.XXX.XXX |
| 96 | +``` |
| 97 | +and set the `ipv4_address` variable with the instance public IP address. |
| 98 | + |
| 99 | +2. In the `aeronim` section, comment the `network_mode: host` line. |
| 100 | + |
| 101 | +3. At the bottom of the file, add the following block: |
| 102 | +``` |
| 103 | +networks: |
| 104 | + outside: |
| 105 | + driver: bridge |
| 106 | + ipam: |
| 107 | + driver: default |
| 108 | + config: |
| 109 | + - subnet: XXX.XXX.XXX.0/24 |
| 110 | +``` |
| 111 | +where the subnet mask is your public IP address with the last number replaced by 0. |
| 112 | + |
| 113 | +## Running the blueprint |
| 114 | + |
| 115 | +To start the digital twin, simply run the following command: |
| 116 | +``` |
| 117 | +sudo docker compose up -d |
| 118 | +``` |
| 119 | +The blueprint will take some time to initialize. Expect a minimum of 10 minutes before accessing the GUI in a web browser at `http://XXX.XXX.XXX.XXX:5273` where `XXX.XXX.XXX.XXX` is the public IP address of the instance. You should something like the image below. |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +Run `sudo docker compose down` to stop the project. |
| 124 | + |
| 125 | + |
| 126 | +## External links |
| 127 | + |
| 128 | +* [Original NVIDIA GitHub repo](https://github.com/NVIDIA-Omniverse-blueprints/digital-twins-for-fluid-simulation) |
| 129 | + |
| 130 | +## License |
| 131 | + |
| 132 | +Copyright (c) 2025 Oracle and/or its affiliates. |
| 133 | + |
| 134 | +Licensed under the Universal Permissive License (UPL), Version 1.0. |
| 135 | + |
| 136 | +See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details. |
0 commit comments