Skip to content

Commit 88bdbca

Browse files
authored
Add files via upload
1 parent 1f0e63e commit 88bdbca

5 files changed

Lines changed: 57 additions & 79 deletions

File tree

cuopt/introduction/introduction.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
In this workshop we will run Nvidia container on oci instance with an A10 shape which has GPU. You will launch an A10 instance with oracle linux and run a set of commands to achieve it.
66

7-
NVIDIA cuOpt is an optimization tool that specializes in routing. It is run as a microservice in the cloud using the container provided. The cuOpt microservice leverages OpenAPI standards, serving endpoints running on port 5000 (by default) to accept optimization input data and return optimized routing solutions.
7+
NVIDIA cuOpt is an optimization tool that specializes in routing. It is run as a microservice in the cloud using the container provided. The cuOpt microservice leverages OpenAPI standards, serving endpoints running on port 8000 (by default) to accept optimization input data and return optimized routing solutions.
88

99
Estimated Workshop Time: 45 minutes
1010

@@ -21,11 +21,10 @@ In this workshop, you will learn how to:
2121
This lab assumes you have:
2222

2323
* An Oracle Cloud account.
24-
* Administrator permissions or permissions to use the OCI Compute, Identity Domains, A10 images, NGC API Key.
24+
* Administrator permissions or permissions to use the OCI Compute, Identity Domains and A10 shapes
2525

2626
## Learn More
2727

28-
* [What Is NGC API Key?](https://docs.nvidia.com/ai-enterprise/deployment-guide-spark-rapids-accelerator/0.1.0/appendix-ngc.html)
2928
* [What is NVIDIA cuOpt?](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cuopt/containers/cuopt)
3029

3130
You may now proceed to the next lab.
@@ -35,4 +34,3 @@ You may now proceed to the next lab.
3534
**Authors**
3635

3736
* **Guido Alejandro Ferreyra**, Principal Cloud Architect, NACIE
38-
* **Abhinav Jain**, Senior Cloud Engineer, NACIE

cuopt/provision/images/a10.png

-880 KB
Loading
-611 KB
Loading

cuopt/provision/images/gpu.png

-671 KB
Loading

cuopt/provision/provision.md

Lines changed: 55 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Provisioning of Nvidia container
1919
This lab assumes you have:
2020

2121
* An Oracle account
22-
* Administrator permissions or permissions to use the OCI Compute, Identity Domains, A10 images, NGC API Key.
22+
* Administrator permissions or permissions to use the OCI Compute, Identity Domains, A10 shapes available.
2323

2424
## Task 1: Launch an A10 instance
2525

2626
1. Go to Compute -> Instance -> Create Instance. Under Image and Shape choose A10 shape as shown in the image below.
2727

2828
![A10](images/a10.png)
2929

30-
2. Click on Change Image and select Gen2-GPU-2024 (one on the top) as Image Build under Oracle Linux 8. Shown in the image below.
30+
2. Click on Change Image and select the latest GPU version (one on the top) as Image Build under Oracle Linux 8. Shown in the image below.
3131

3232
![GPU](images/gpu.png)
3333

@@ -37,53 +37,59 @@ Click **Create**
3737

3838
![Create_Instance](images/create_instance.png)
3939

40-
## Task 2: Run Nvidia Container
40+
## Task 2: Install NVIDIA container toolkit
4141

4242
1. In few minutes the status of recently created instance will change from **Provisioning** to **Running**.
4343

44-
2. Access the instance using the public ip of the instance with the following command 'ssh -i <ssh_key> opc@public_ip'.
44+
2. Access the instance using the public ip of the instance with the following command:
4545

46-
3. Install nvidia-container-toolkit
46+
```text
47+
<copy>
48+
ssh -i <ssh_key> opc@public_ip
49+
</copy>
50+
```
51+
52+
5. Install nvidia-container-toolkit
4753
4854
```text
4955
<copy>
5056
curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
5157
</copy>
5258
```
5359
54-
4. Run the following command
60+
6. Run the following command
5561
5662
```text
5763
<copy>
5864
sudo yum install -y nvidia-container-toolkit
5965
</copy>
6066
```
6167
62-
5. Generate CDI configuration for podman
68+
7. Generate CDI configuration for podman
6369
6470
```text
6571
<copy>
6672
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
6773
</copy>
6874
```
6975
70-
6. Setup nvidia driver to be persistent across reboots
76+
8. Setup nvidia driver to be persistent across reboots
7177
7278
```text
7379
<copy>
7480
sudo nvidia-persistenced
7581
</copy>
7682
```
7783
78-
7. Run the following command.
84+
9. Run the following command.
7985
8086
```text
8187
<copy>
8288
sudo systemctl enable nvidia-persistenced
8389
</copy>
8490
```
8591
86-
8. Install podman
92+
10. Install podman
8793
8894
```text
8995
<copy>
@@ -105,92 +111,66 @@ Click **Create**
105111
</copy>
106112
```
107113

108-
## Task 3: Generate NGC API Key
109-
110-
Follow the steps listed in the following link to generate an api key which will be used in next task. [NGC API Key](https://docs.nvidia.com/ai-enterprise/deployment-guide-spark-rapids-accelerator/0.1.0/appendix-ngc.html)
111-
112-
## Task 4: Continue with Steps to run the container
113-
114-
1. Login to nvcr.io. Use the api key generated in previous step.
115-
116-
```text
117-
<copy>
118-
sudo podman login nvcr.io --username '$oauthtoken' --password $api_key
119-
</copy>
120-
```
121-
122-
2. Pull cuopt from nvcr.io
123-
124-
```text
125-
<copy>
126-
sudo podman pull nvcr.io/nvidia/cuopt/cuopt:25.08
127-
</copy>
128-
```
129-
130-
3. Create systemd service file for cuopt
131-
132-
```text
133-
<copy>
134-
sudo tee /etc/systemd/system/cuopt.service <<EOF
135-
[Unit]
136-
Description=Podman cuopt Container
137-
After=network.target
138-
[Service]
139-
Type=simple
140-
Restart=always
141-
ExecStart=/usr/bin/podman run --rm --device nvidia.com/gpu=all -p 5000:5000 nvcr.io/nvidia/cuopt/cuopt:25.08
142-
[Install]
143-
WantedBy=multi-user.target
144-
EOF
145-
</copy>
146-
```
114+
## Task 3: Run NVIDIA cuOpt container
147115

148-
4. Reload systemd and start the service
116+
1. Run the cuopt image
149117

150118
```text
151119
<copy>
152-
sudo systemctl daemon-reload
120+
sudo podman run --rm --device nvidia.com/gpu=all -p 8000:8000 -e CUOPT_SERVER_PORT=8000 docker.io/nvidia/cuopt:latest-cuda12.8-py3.12
153121
</copy>
154122
```
155123
156-
```text
157-
<copy>
158-
sudo systemctl start cuopt.service
159-
</copy>
160-
```
124+
## Task 4: Test cuOpt with an API call
161125
162-
5. Enable automatic start on boot
126+
Open a new SSH session with the following command (leave the previous one open so you will be able to see cuOpt logs) :
163127
164-
```text
165-
<copy>
166-
sudo systemctl enable cuopt.service
167-
</copy>
168-
```
128+
```text
129+
<copy>
130+
ssh -i <ssh_key> opc@public_ip -L 8000:localhost:8000
131+
</copy>
132+
```
169133

170-
## Task 5: Test cuOpt with an API call
134+
```text
135+
<copy>
136+
curl --location 'http://localhost:8000/cuopt/request' \
137+
--header 'Content-Type: application/json' \
138+
--header 'Accept: application/json' \
139+
--data '{
140+
"cost_matrix_data": { "data": { "0": [[0, 1], [1, 0]] } },
141+
"task_data": {
142+
"task_locations": [1],
143+
"demand": [[1]],
144+
"task_time_windows": [[0, 10]],
145+
"service_times": [1]
146+
},
147+
"fleet_data": {
148+
"vehicle_locations": [[0, 0]],
149+
"capacities": [[2]],
150+
"vehicle_time_windows": [[0, 20]]
151+
},
152+
"solver_config": { "time_limit": 1 }
153+
}'
154+
</copy>
155+
```
171156

172-
Run the following command to test the container
157+
You will receive a reqId. Now run the following command, and you should see that the request has been completed:
173158

174159
```text
175160
<copy>
176-
curl --location 'http://0.0.0.0:5000/cuopt/routes' \
177-
--header 'Content-Type: application/json' \
178-
--header "CLIENT-VERSION: custom" \
179-
-d '{
180-
"cost_matrix_data": {"data": {"0": [[0, 1], [1, 0]]}},
181-
"task_data": {"task_locations": [1], "demand": [[1]], "task_time_windows": [[0, 10]], "service_times": [1]},
182-
"fleet_data": {"vehicle_locations":[[0, 0]], "capacities": [[2]], "vehicle_time_windows":[[0, 20]] },
183-
"solver_config": {"time_limit": 2}
184-
}'
161+
curl --location 'http://localhost:8000/cuopt/result/YOUR_REQUEST_ID' \
162+
--header 'Accept: application/json'
185163
</copy>
186164
```
165+
## Task 5: Discover the cuOpt documentation
166+
167+
On your local machine, go to http://localhost:8000/cuopt/docs , where you can also run multiple tests.
187168

188169
## Acknowledgements
189170

190171
**Authors**
191172

192173
* **Guido Alejandro Ferreyra**, Principal Cloud Architect, NACIE
193-
* **Abhinav Jain**, Senior Cloud Engineer, NACIE
194174

195175
**Last Updated By/Date:**
196-
* **Abhinav Jain**, Senior Cloud Engineer, NACIE, August 2025
176+
* **Guido Alejandro Ferreyra**, Principal Cloud Architect, NACIE, December 2015

0 commit comments

Comments
 (0)