Skip to content

Instantly share code, notes, and snippets.

@felixfong227
Last active December 2, 2025 02:20
Show Gist options
  • Select an option

  • Save felixfong227/11fc35714564c740ed16465b71424a9d to your computer and use it in GitHub Desktop.

Select an option

Save felixfong227/11fc35714564c740ed16465b71424a9d to your computer and use it in GitHub Desktop.
How to install and benmark AI on Ubuntu
docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.18.0-1
sudo apt-get install -y \
nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
providers:
docker:
exposedByDefault: false
entryPoints:
web:
address: :80
api:
dashboard: true
insecure: true
upstream core {
zone core 64k;
server core:8000;
}
upstream minio {
zone minio 64k;
server minio:9000;
}
server {
listen 80;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(self), geolocation=(), interest-cohort=()" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
# File upload settings - support up to 5GB files
client_max_body_size 5G;
client_body_timeout 3600s; # 1 hour for large file uploads
client_body_buffer_size 128k;
client_body_temp_path /tmp/nginx_upload_temp;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/javascript
application/xml+rss
application/json;
location / {
# Serve vad files with correct MIME type
include /etc/nginx/mime.types;
types {
application/javascript js mjs;
}
root /workspace/web;
index index.html;
try_files $uri $uri/ /index.html =404;
}
location /api/ {
proxy_pass http://core/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Proxy headers for proper forwarding
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Proxy timeouts for large file uploads (up to 1 hour)
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
# Disable proxy buffering for large file uploads
proxy_buffering off;
proxy_request_buffering off;
# Increase max body size for this location as well
client_max_body_size 5G;
}
location /minio/ {
proxy_pass http://minio/;
proxy_http_version 1.1;
# Set Host header to match what's in the presigned URL signature
# The signature was generated with Host: minio:9000
proxy_set_header Host minio:9000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Proxy timeouts for large file uploads and downloads (up to 1 hour)
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
# Disable buffering for streaming large files
proxy_buffering off;
proxy_request_buffering off;
# Allow large file uploads through MinIO
client_max_body_size 5G;
# Allow CORS headers from MinIO
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Access-Control-Allow-Methods';
proxy_hide_header 'Access-Control-Allow-Headers';
}
}
# RabbitMQ Development Configuration
# Limits message size to 50MB
max_message_size = 52428800
# Default operator policy: limit total queue size to 1GB
default_policies.operator.dev_limits.vhost_pattern = .*
default_policies.operator.dev_limits.queue_pattern = .*
default_policies.operator.dev_limits.max_length_bytes = 1073741824
tls:
certificates:
- certFile: /path/to/certificate.crt
keyFile: /path/to/private.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment