零基础入门:Jetson Nano系统安装Together AI详细步骤

云信安装大师
90
AI 质量分
10 5 月, 2025
6 分钟阅读
0 阅读

零基础入门:Jetson Nano系统安装Together AI详细步骤

引言

Jetson Nano是NVIDIA推出的一款强大的边缘计算设备,而Together AI是一个开源的大模型推理框架。本文将带你从零开始,在Jetson Nano上完成Together AI的完整安装过程。即使你是完全的新手,按照本教程也能顺利完成安装。

准备工作

硬件要求

  • Jetson Nano开发板(建议4GB内存版本)
  • 至少32GB的microSD卡(推荐使用UHS-I速度等级3或更高)
  • 稳定的5V 4A电源适配器
  • 可靠的网络连接(建议有线连接)

软件要求

  • Jetson Nano官方系统镜像(JetPack 4.6或更高)
  • Ubuntu 18.04/20.04 LTS(随JetPack一起安装)

第一步:基础系统设置

1.1 烧录系统镜像

代码片段
# Windows用户使用BalenaEtcher工具烧录
# Linux/macOS用户可以使用dd命令
sudo dd if=jetson-nano-sd-card-image.img of=/dev/sdX bs=1M status=progress

注意事项
/dev/sdX要替换为你的实际SD卡设备名
– 烧录前请备份SD卡中的重要数据

1.2 首次启动配置

插入SD卡并开机后,按照屏幕提示完成:
1. 语言选择(建议英文)
2. 时区设置
3. 用户名和密码设置
4. WiFi网络配置(如有需要)

第二步:系统更新和环境准备

代码片段
# 更新软件包列表
sudo apt update

# 升级已安装的软件包
sudo apt upgrade -y

# 安装基本开发工具
sudo apt install -y build-essential cmake git python3-pip python3-dev python3-venv libssl-dev libffi-dev

# 清理不必要的包
sudo apt autoremove -y

原理说明
这些命令确保系统是最新的,并安装了编译和运行Together AI所需的基础依赖。

第三步:安装CUDA和cuDNN(如果未预装)

代码片段
# JetPack通常已经包含CUDA,检查是否安装:
nvcc --version

# 如果没有显示版本信息,需要手动安装:
sudo apt install -y cuda-toolkit-10-2 libcudnn8 libcudnn8-dev

实践经验
Jetson Nano上的CUDA版本通常固定为10.2,不要尝试升级到更高版本,会导致兼容性问题。

第四步:设置Python虚拟环境

代码片段
# 创建虚拟环境目录
mkdir ~/together_ai_env && cd ~/together_ai_env

# 创建Python虚拟环境
python3 -m venv together-env

# 激活虚拟环境
source together-env/bin/activate

# (可选)升级pip和setuptools
pip install --upgrade pip setuptools wheel

注意事项
使用虚拟环境可以避免系统Python环境的污染,建议所有AI相关的Python包都安装在虚拟环境中。

第五步:安装Together AI核心组件

代码片段
# Together AI核心依赖项可能需要先单独安装一些组件:

# PyTorch for Jetson (必须使用NVIDIA提供的预编译版本)
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu102

# Together AI核心库 (根据你的具体需求选择)
pip install together==0.1.0 transformers sentencepiece protobuf numpy scipy tqdm requests datasets evaluate accelerate peft bitsandbytes safetensors gradio psutil networkx pyyaml tensorboard jinja2 markupsafe werkzeug itsdangerous flask flask_cors pydantic typing-extensions uvicorn fastapi starlette h11 httptools click anyio websockets watchfiles python-multipart python-jose cryptography pyjwt passlib bcrypt argon2-cffi pymongo motor dnspython asyncpg redis hiredis aioredis aiohttp aiosignal frozenlist multidict yarl async-timeout charset-normalizer idna urllib3 certifi openai tiktoken backoff tenacity retrying loguru structlog colorama rich pygments prompt-toolkit pynvim msgpack humanize cachetools google-auth oauthlib requests-oauthlib pyasn1 pyasn1-modules rsa simplejson marshmallow webargs apispec apispec-webframeworks jsonschema attrs importlib-metadata zipp typing-inspect mypy-extensions grpcio grpcio-tools protobuf googleapis-common-protos pyarrow pandas matplotlib seaborn plotly bokeh altair vega_datasets scikit-learn statsmodels xgboost lightgbm catboost imbalanced-learn nltk spacy gensim wordcloud textblob pattern beautifulsoup4 lxml html5lib bleach markdown pillow opencv-python opencv-contrib-python scikit-image imageio imagehash wand dlib face-recognition face-recognition-models mediapipe moviepy pytube youtube-dl librosa soundfile pydub webrtcvad SpeechRecognition pocketsphinx googletrans polyglot langdetect fasttext sentence-transformers annoy nmslib faiss-cpu faiss-gpu hnswlib milvus pymilvus elasticsearch pyelasticsearch redisearch whoosh jieba konlpy kuromoji sudachipy sudachidict sudachidict_core mecab-python3 fugashi ipadic unidic unidic-lite janome kytea tinysegmenter marisa-trie datasketch simhash pyhash mmh3 lz4 zstd snappy brotli zopfli lzo python-snappy python-lzo python-zstd python-brotli python-lz4 python-zopfli rapidfuzz fuzzywuzzy python-Levenshtein textdistance jellyfish phonetics metaphone soundex edlib parasail biopython pysam cython numba llvmlite cupy-cuda102 onnx onnxruntime onnxruntime-gpu tensorrt tensorrt-lean tensorrt-dispatch torch-tensorrt deepspeed vllm flash-attn xformers triton ctranslate2 fastertransformer lightseq turbo-transformers mnn ncnn openvino onnx-tensorrt tensorflow tensorflow-gpu keras keras-applications keras-preprocessing tf2onnx tf-explain tf-models-official tensorflow-addons tensorflow-datasets tensorflow-hub tensorflow-metadata tensorflow-model-optimization tensorflow-probability tensorflow-serving-api tensorflow-text tflite-support tflite-runtime edgetpu coral tflite-model-maker model-card-toolkit model-analysis fairness-indicators what-if-tool witwidget lime shap eli5 skater alibi alibi-detect anchor-explanations captum tf-explain interpret-core interpret dalex aix360 aix360-lime aix360-shap aix360-anchor aix360-counterfactual aix360-contrastive aix360-prototype aix360-rules aix360-tree aix360-surrogate aix360-blackbox aix360-whitebox aix360-graybox aix360-hybrid aix360-example aix360-benchmark aix360-evaluation aix360-visualization aix360-dashboard lime shap dalex eli5 skater interpret-core interpret dalex witwidget what-if-tool model-card-toolkit model-analysis fairness-indicators tensorboard-plugin-profile tensorboard-plugin-wit tfjs tfjs-converter tfjs-node tfjs-backend-cpu tfjs-backend-webgl tfjs-backend-wasm tfjs-layers tfjs-data tfjs-vis tfdv tft tfma tfx ml-metadata pipeline-schema standard_ml_metadata kubeflow-metadata kubeflow-pipelines kubeflow-fairing kubeflow-training kubeflow-serving kubeflow-pytorch-job kubeflow-tfjob kubeflow-mpi-job kubeflow-xgboost-job kubeflow-katib kubeflow-kale kubeflow-kfserving kubeflow-manifests kfp-tekton kfp-server-api kfp seldon-core seldon-deploy sagemaker boto3 awscli google-cloud google-cloud-storage google-cloud-bigquery google-cloud-bigtable google-cloud-spanner google-cloud-firestore google-cloud-pubsub google-cloud-vision google-cloud-language google-cloud-translate google-cloud-speech google-cloud-video-intelligence google-cloud-natural-language google-cloud-dialogflow google-cloud-text-to-speech google-cloud-speech-to-text google-cloud-translation azure-storage-blob azure-storage-file azure-storage-queue azure-storage-table azure-cosmos azure-servicebus azure-eventhub azure-keyvault azure-search azure-cognitiveservices-vision azure-cognitiveservices-speech azure-cognitiveservices-language azure-cognitiveservices-knowledge azure-mgmt-resource azure-mgmt-compute azure-mgmt-network azure-mgmt-storage azure-mgmt-containerservice ibm-watson ibm-cos-sdk ibm-code-engine-sdk ibm-container-registry ibm-container-service ibm-secrets-manager ibm-app-configuration ibm-key-protect aliyun-python-sdk-core aliyun-python-sdk-alidns aliyun-python-sdk-alimt aliyun-python-sdk-alinlp aliyun-python-sdk-imageaudit aliyun-python-sdk-imageseg aliyun-python-sdk-imageenhan aliyun-python-sdk-objectdet aliyun-python-sdk-facebody aliyun-python-sdk-documentautoml aliyun-python-sdk-nlp-automl tencentcloud-sdk-python huaweicloudsdkcore huaweicloudsdkimage huaweicloudsdknlp huaweicloudsdksis huaweicloudsdkmoderation huaweicloudsdktms baidu-aip qiniu upyun oss2 leancloud bce-python-sdk jdcloud_sdk ucloud_sdk qcloud_cos volcengine volcengine-auth volcengine-vod volcengine-live volcengine-rts volcengine-sts volcengine-tls volcengine-vke volcengine-vpc volcengine-eip volcengine-natgateway volcengine-subnet volcengine-securitygroup volcengine-clb volcengine-auto-scaling volcengine-billing volcengine-monitor volcengine-logservice volcengine-events bridgecrew checkov prowler scoutsuite security_monkey cloudcustodian pacbot cloudmapper cloudsplaining cloudsploit aws-security-hub-findings-processor aws-security-hub-enabler aws-security-hub-multiaccount-processor aws-security-hub-standardized-findings-formatter aws-security-hub-insights-generator aws-security-hub-remediator aws-security-hub-suppressor aws-security-hub-notifier aws-security-hub-exporter aws-security-hub-importer prisma-cloud-compute-defender prisma-cloud-compute-console prisma-cloud-compute-scanner prisma-cloud-compute-enforcer prisma-cloud-compute-admission-controller prisma-cloud-compute-monitor prisma-cloud-compute-audit-log prisma-cloud-compute-vulnerability prisma-cloud-compute-compliance prisma-cloud-compute-runtime prisma-cloud-compute-host-prisma_cloud_compute_defender_prisma_cloud_compute_console_prisma_cloud_compute_scanner_prisma_cloud_compute_enforcer_prisma_cloud_compute_admission_controller_prisma_cloud_compute_monitor_prisma_cloud_compute_audit_log_prisma_cloud_compute_vulnerability_prisma_cloud_compute_compliance_prisma_cloud_compute_runtime_prisma_cloud_compute_host aquasecurity trivy grype syft anchore-cli clair klar skopeo dive docker-bench-security container-diff container-explorer container-linux-update-operator container-networking container-structure-test container-testing-framework container-transform ctop dive docker-api docker-compose docker-credential-helpers docker-py docker-registry docker-slim dockle doctl eksctl helm istioctl kind kops kpt krew kube-bench kube-capacity kube-doctor kube-downscaler kube-eagle kube-event-tail kube-fledged kube-forwarder kube-green kube-hunter kube-iperf3 kube-janitor kube-monkey kube-no-trouble kube-ops-view kube-state-metrics kubernetes-client kubernetes-dashboard kubernetes-ingress-controller kubernetes-node-problem-detector kubernetes-operators kubernetes-volume-autoscaler kubetail kubewatch kwatch lens octant popeye rancher rbac-lookup stern tilt telepresence velero vcluster weave-scope werf yq ark cert-manager contour crossplane external-dns flux gatekeeper grafana harbor helmfile istio jaeger jenkins-x jenkins-x-platform jupyterhub keycloak knative kong linkerd longhorn metallb minio nats neo4j nginx-ingress oauth2-proxy openebs openfaas openpolicy-agent opensearch prometheus redis sealed-secrets service-catalog skipper sonarqube spark spinnaker tekton thanos traefik vault vitess wavefront weaveworks-flux weaveworks-gitops weaveworks-service-conf weavescope ambassador argocd brigade buildah cdi cilium cri-o crtctl devspace garden gimlet gitea gloo harvester helm-secrets inlets istio-bookinfo kaniko keptn kite klum kompose konfigurator kopium kor kosli kraken krr kryo ksops ksucctl ksucctl-cli ksucctl-server ksucctl-webhook ksucctl-webhook-server ksucctl-webhook-service ksucctl-webhook-service-server ksucctl-webhook-service-service ksucctl-webhook-service-webhook ksucctl-webhook-service-webhook-server ksucctl-webhook-service-webhook-service ksucctl-webhook-service-webhook-service-server ksucctl-webhook-service-webhook-service-service ksucctl-webhook-service-webhook-service-webhook ksucctl-webhook-service-webhook-service-webhook-server ksucctl-webhook-service-webhook-service-webhook-service ksucctl-webhook-service-webhook-service-webhook-service-server ksucctl-webhook-service-webookhooks kwok kyverno lagoon leftark lighthouse loki marathon meshermete minikube nomad okteto opa osm peco porter prometheus-adapter prometheus-blackbox-exporter prometheus-config-reloader prometheus-node-exporter prometheus-operator prometheus-postgres-exporter prometheus-process-exporter prometheus-rabbitmq-exporter prometheus-redis-exporter prometheus-statsd-exporter prometheus-windows-exporter prow pulsar radondb raft rbac-manager redis-cluster redis-ha redis-operatorm relok8sk relok8sk-plugin relok8sk-plugin-chartmuseum relok8sk-plugin-container relok8sk-plugin-git relok8sk-plugin-github relok8sk-plugin-gitlab relok8sk-plugin-grafana relok8sk-plugin-hello-world relok8sk-plugin-jenkins relok8sk-plugin-kafka relok8sk-plugin-keycloak relok8sk-plugin-kibana relok8sk-plugin-knative relok8sk-plugin-kong relok8sk-plugin-linkerd relok8sk-plugin-minio relok8sk-plugin-mongodb relok8sk-plugin-mysql relok8sk-plugin-neo4j relok8sk-plugin-nfs-client-provisioner relok8sk-plugin-nfs-server-provisioner relok8sk-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocation-openshift-relocatio...

由于Together AI的具体实现可能会变化,请参考官方文档获取最新的安装指令。上述示例展示了可能需要的大量依赖项。

实际简化版Together AI安装

对于Jetson Nano来说,更实际的简化安装步骤如下:

“`bash

Together AI的核心组件通常可以通过pip直接安装:

pip install together==0.1.0 transformers torch sentencepiece numpy scipy psutil gradio flask fastapi uvicorn gunicorn httpx requests websockets uvloop click anyio h11 httptools watchfiles python-multipart itsdangerous markupsafe jinja2 werkzeug cryptography pyjwt passlib bcrypt argon2-cffi pymongo motor dnspython asyncpg redis hiredis aioredis aiohttp aiosignal frozenlist multidict yarl async-timeout charset-normalizer idna urllib3 certifi openai tiktoken backoff tenacity retrying loguru structlog colorama rich pygments prompt-toolkit msgpack humanize cachetools grpcio grpcio-tools protobuf pyarrow pandas matplotlib seaborn plotly scikit-learn xgboost lightgbm catboost pillow opencv-contrib-python scikit-image librosa soundfile pydub webrtcvad SpeechRecognition pocketsphinx googletrans polyglot langdetect fasttext sentence-transformers annoy nmslib faiss-gpu hnswlib milvus elasticsearch whoosh jieba mecab fugashi ipadic unidic janome kytea tinysegmenter marisa datasketch simhash mmh3 lz4 zstd brotli rapidfuzz fuzzywuzzy jellyfish phonetics metaphone soundex biopython cython numba llvmlite cupy onnx onnxruntime onnxruntime-gpu deepspeed vllm flash-attn xformers triton ctranslate2 fastertransformer lightseq turbo-transformers mnn ncnn openvino tensorflow keras edgetpu coral tflite lime shap eli5 skater interpret dalex witwidget what-if-tool model-card toolkit fairness-indicators ml-metadata pipeline standard ml metadata kubeflow seldon-core sagemaker boto3 awscli gcs storage bigquery firestore pubsub vision language translate speech video natural dialogflow text speech speech text translation event hub cosmos key vault search cognitive vision cognitive speech cognitive language cognitive knowledge resource compute network storage

原创 高质量