728x90

출처

CUDA 버전 확인

bluesanta@localhost:~$ cat /proc/device-tree/model
NVIDIA Jetson Orin NX Engineering Reference Developer Kit
bluesanta@localhost:~$ uname -a
Linux localhost.localdomain 6.8.12-1021-tegra #1 SMP PREEMPT Thu Aug  6 21:56:04 PDT 2026 aarch64 aarch64 aarch64 GNU/Linux
bluesanta@localhost:~$ cat /etc/nv_tegra_release
## R39 (release), REVISION: 2.1, GCID: 46758480, BOARD: generic, EABI: aarch64, DATE: Fri Aug  7 05:54:22 AM UTC 2026
## KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
bluesanta@localhost:~$ nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv
name, compute_cap, driver_version
Orin (nvgpu), 8.7, 595.78
bluesanta@localhost:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Fri_May_08_10:52:52_AM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.86
Build cuda_13.2.r13.2/compiler.37953736_0

파이썬 버전 확인

bluesanta@localhost:~$ python --version
Python 3.12.3

빌드 도구 설치

bluesanta@localhost:~$ sudo apt upgrade
bluesanta@localhost:~$ sudo apt install -y cmake ninja-build gcc g++ git build-essential git cmake ninja-build libopenblas-dev libopenmpi-dev openmpi-bin libatlas-base-dev libprotobuf-dev protobuf-compiler libssl-dev zlib1g-dev libffi-dev python3-pip libopenblas-dev ccache git-lfs libjpeg-dev libpng-dev libtiff-dev

원격 데스크톱(xrdp) 설치

xrdp 패키지 설치 및 기본 활성화

서버 터미널(SSH)에서 아래 명령어를 실행하여 xrdp를 설치하고 서비스 등록을 진행합니다.

$ # 패키지 목록 업데이트 및 xrdp 설치
$ sudo apt update
$ sudo apt install -y xrdp
$ 
$ # 부팅 시 자동 시작 등록 및 서비스 시작
$ sudo systemctl enable --now xrdp
$ 
$ # SSL 인증서 권한 추가 (중요: xrdp 계정이 ssl-cert 키를 읽을 수 있어야 함)
$ sudo adduser xrdp ssl-cert
$ 
$ # 서비스 재시작
$ sudo systemctl restart xrdp

데스크톱 환경 세션 파일(~/.xsession) 생성

xrdp 접속 시 띄울 윈도우 매니저(세션)를 명시적으로 설정해 주어야 검은 화면에서 튕기는 현상을 막을 수 있습니다.

$ echo "gnome-session" > ~/.xsession
$ chmod +x ~/.xsession

GNOME 확장(Extensions) 관리 유틸리티 설치

bluesanta@localhost:~$ sudo apt install -y gnome-shell-extension-manager gnome-tweaks

오류 확인

bluesanta@localhost:~$ cat .xsession-errors
Xsession: X session started for bluesanta at Mon Sep 28 05:13:10 PM KST 2026
dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/2002/bus
dbus-update-activation-environment: setting DISPLAY=:10.0
localuser:bluesanta being added to access control list
/etc/X11/Xsession: 85: /home/bluesanta/.xsessionrc: Syntax error: "(" unexpected (expecting "fi")

~/.xsessionrc를 POSIX sh 호환 문법으로 수정

48번 줄 수정 (== → =)

# 기존
if [ "$(lsb_release -cs)" == "bionic" ]; then

# 변경
if [ "$(lsb_release -cs)" = "bionic" ]; then

85~91번 줄 수정 (배열 문법 제거)

# 기존
if [ -e "/usr/bin/gnome-shell" ]; then
	remove_apps=("thunderbird" "rhythmbox" "libreoffice-writer")
	favorite_apps="$(gsettings get org.gnome.shell favorite-apps)"

	for app in "${remove_apps[@]}"; do
		favorite_apps="$(echo "${favorite_apps}" | \
			sed -e "s/'${app}.desktop', //g" -e "s/, '${app}.desktop' / /g")"
	done

	gsettings set org.gnome.shell favorite-apps "${favorite_apps}"
fi
# 변경
if [ -e "/usr/bin/gnome-shell" ]; then
	favorite_apps="$(gsettings get org.gnome.shell favorite-apps)"

	for app in thunderbird rhythmbox libreoffice-writer; do
		favorite_apps="$(echo "${favorite_apps}" | \
			sed -e "s/'${app}.desktop', //g" -e "s/, '${app}.desktop' / /g")"
	done

	gsettings set org.gnome.shell favorite-apps "${favorite_apps}"
fi

도커 로그인

bluesanta@localhost:~$ docker login
 
USING WEB-BASED LOGIN
 
i Info → To sign in with credentials on the command line, use 'docker login -u '
         
 
Your one-time device confirmation code is: XXXX-XXXX
Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate
 
Waiting for authentication in the browser…
 
WARNING! Your credentials are stored unencrypted in '/home/bluesanta/.docker/config.json'.
Configure a credential helper to remove this warning. See
https://docs.docker.com/go/credential-store/
 
Login Succeeded

도커 로그인

Gemma 4 E4B | Jetson AI Lab

bluesanta@localhost:~$ sudo docker run -it --rm --pull always --runtime=nvidia --network host -v ~/.cache/huggingface:/root/.cache/huggingface -v ~/.cache/vllm:/root/.cache/vllm vllm/vllm-openai:latest google/gemma-4-E4B-it-qat-w4a16-ct --max-model-len 8192 --gpu-memory-utilization 0.7 --reasoning-parser gemma4 --enable-auto-tool-choice --tool-call-parser gemma4 --default-chat-template-kwargs '{"enable_thinking":true}' --speculative-config '{"method":"mtp","model":"google/gemma-4-E4B-it-assistant","num_speculative_tokens":3}'
latest: Pulling from vllm/vllm-openai

도커 로그인

Gemma 4 E4B | Jetson AI Lab

bluesanta@localhost:~/llm/models$ sudo docker run -it --rm --pull always \
  --runtime=nvidia --network host \
  ghcr.io/nvidia-ai-iot/vllm:latest-jetson-orin \
  vllm serve /home/bluesanta/llm/models/gemma-3-12b-it-quantized.w4a16 --gpu-memory-utilization 0.8
latest-jetson-orin: Pulling from nvidia-ai-iot/vllm

 

 

 

 

728x90
728x90

출처

CUDA 버전 확인

bluesanta@localhost:~$ cat /proc/device-tree/model
NVIDIA Jetson Orin Nano Engineering Reference Developer Kit Super
bluesanta@localhost:~$ uname -a
Linux localhost.localdomain 6.8.12-1021-tegra #1 SMP PREEMPT Thu Aug  6 21:56:04 PDT 2026 aarch64 aarch64 aarch64 GNU/Linux
bluesanta@localhost:~$ cat /etc/nv_tegra_release
## R39 (release), REVISION: 2.1, GCID: 46758480, BOARD: generic, EABI: aarch64, DATE: Fri Aug  7 05:54:22 AM UTC 2026
## KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
bluesanta@localhost:~$ nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv
name, compute_cap, driver_version
Orin (nvgpu), 8.7, 595.78
bluesanta@localhost:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Fri_May_08_10:52:52_AM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.86
Build cuda_13.2.r13.2/compiler.37953736_0

파이썬 버전 확인

bluesanta@localhost:~$ python --version
Python 3.12.3

빌드 도구 설치

bluesanta@localhost:~$ sudo apt update
bluesanta@localhost:~$ sudo apt install -y cmake ninja-build gcc g++ git build-essential git cmake ninja-build libopenblas-dev libopenmpi-dev openmpi-bin libatlas-base-dev libprotobuf-dev protobuf-compiler libssl-dev zlib1g-dev libffi-dev python3-pip libopenblas-dev ccache git-lfs libjpeg-dev libpng-dev libtiff-dev
728x90
728x90

출처

llama.cpp 설치 확인

bluesanta@localhost:~$ llama-cli --version
version: 0.1.2-dev (build 10547, commit 749f688fc)
built with GNU 13.3.0 for Linux aarch64

llama.cpp 설치 확인

bluesanta@localhost:~$ cd llm
bluesanta@localhost:~/llm$ llama-cli -m ./models/Qwen3.8-27B-UD-Q4_K_M.gguf --mmproj ./models/Qwen3.8-27B-mmproj-F16.gguf -ngl 999 --spec-type draft-mtp -p "한글은 누가 만들었어?"
 
 
Loading model...  
 
▄▄ ▄▄
██ ██
██ ██  ▀▀█▄ ███▄███▄  ▀▀█▄    ▄████ ████▄ ████▄
██ ██ ▄█▀██ ██ ██ ██ ▄█▀██    ██    ██ ██ ██ ██
██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
                                    ██    ██
                                    ▀▀    ▀▀
 
build      : b10547-749f688fc
model      : ./models/Qwen3.8-27B-UD-Q4_K_M.gguf
ftype      : Q4_K - Medium
modalities : text, vision, video
 
available commands:
  /exit or Ctrl+C     stop or exit
  /regen              regenerate the last response
  /clear              clear the chat history
  /read         add a text file
  /glob      add text files using globbing pattern
  /image        add an image file
  /video        add a video file
 
 
 
> 한글은 누가 만들었어?
 
[Start thinking]
 
The user is asking in Korean: "Who created Hangul?" This is a straightforward factual question about the history of the Korean writing system.
 
Hangul (한글) was created by King Sejong the Great (세종대왕) and his scholars at the Jiphyeonjeon (집현전) in 1443 (Joseon dynasty). It was officially promulgated in 1446 in the document "Hunminjeongeum" (훈민정음, The Proper Sounds for the Instruction of the People).
 
Let me respond in Korean since the question was asked in Korean.
[End thinking]
 
한글은 조선 제4대 왕인 **세종대왕**(1397~1450)이 1443년에 창제하고, 1446년 **《훈민정음》** 을 반포하면서 세상에 알려졌습니다.
 
세종대왕은 백성들이 한자를 배우기 어려워하는 현실을 안타깝게 여겨, 배우기 쉽면서도 음가를 정확히 표기할 수 있는 문자를 만들 것을 지시했습니다. 세종대왕을 중심으로 **예종(예하), 성삼문, 신숙주, 정인지, 박팽년, 이개** 등 집현전 학자들이 함께 연구·창제에 참여했습니다.
 
한글은 자음의 모양이 발음 기관의 형태를 닮고(예: ㄱ = 혀가 윗니를 막는 모양), 모음의 모양이 하늘·땅·사람의 이치를 담은 **원리 문자**라는 점에서, 문자학적으로도 매우 독창적인 체계로 평가받고 있습니다.
 
[ Prompt: 61.8 t/s | Generation: 9.7 t/s ]
 
> 

서비스 등록

작업 디렉토리

bbluesanta@localhost:~$ sudo mkdir -p /opt/llama.cpp
bluesanta@localhost:~$ sudo chown bluesanta:bluesanta -R /opt/llama.cpp

서비스 파일 생성

bluesanta@localhost:~$ sudo vi /etc/systemd/system/llama.service
[Unit]
Description=Llama.cpp Server Service
After=network.target

[Service]
# 사용자 계정
User=bluesanta
Group=bluesanta
LimitMEMLOCK=infinity
WorkingDirectory=/opt/llama.cpp

# 최적화된 실행 명령어
# --ctx-size 131072 -> 262144 -> 196608
# --spec-type ngram-mod,draft-mtp --spec-draft-n-max 4
ExecStart=/usr/local/bin/llama-server \
    -m /home/bluesanta/llm/models/Qwen3.8-27B-UD-Q4_K_M.gguf \
    --mmproj /home/bluesanta/llm/models/Qwen3.8-27B-mmproj-F16.gguf \
    -ngl all \
    --spec-type draft-mtp \
    --temp 1.0 \
    --top-k 20 \
    --min-p 0.0 \
    --ctx-size 196608 \
    --n-gpu-layers 99 \
    --flash-attn on \
    --mlock \
    --cont-batching \
    --metrics \
    --image-min-tokens 1024 \
    --reasoning-preserve \
    --host 0.0.0.0 \
    --port 8000

# 프로세스 종료 시 자동 재시작 설정
# Restart=always
# RestartSec=5

[Install]
WantedBy=multi-user.target

서비스 등록

bluesanta@localhost:~$ sudo systemctl enable llama.service
Created symlink /etc/systemd/system/multi-user.target.wants/llama.service → /etc/systemd/system/llama.service.

서비스 갱신

bluesanta@localhost:~$ sudo systemctl daemon-reload

서비스 실행

bluesanta@localhost:~$ sudo systemctl start llama

서비스 상태 확인

bluesanta@localhost:~$ sudo systemctl status llama

서비스 로그 확인

bluesanta@localhost:~$ sudo journalctl -u llama.service -f

확인

bluesanta@localhost:~$ curl http://localhost:8000/completion -H "Content-Type: application/json" -d '{
  "prompt": "Jetson AGX Orin의 장점 3가지는?",
  "n_predict": 256
}'
{"index":0,"content":"\n\n\nThe user is asking about 3 advantages of the Jetson AGX Orin. Let me think about the key advantages of this NVIDIA embedded AI computing platform.\n\nNVIDIA Jetson AGX Orin is an embedded AI computing module/platform. Let me recall its key advantages:\n\n1. **High AI Performance (TOPS)**: The Jetson AGX Orin delivers up to 275 TOPS of AI performance (the developer kit), making it one of the most powerful embedded AI processors available. It uses a custom Arm Cortex-A78AE CPU and Ampere GPU with 2048 CUDA cores and 64 Tensor cores.\n\n2. **Power Efficiency**: It achieves this high performance while being power efficient, consuming power in the range of 15W to 60W (configurable). This makes it suitable for edge/embedded applications where power is constrained (robots, drones, autonomous vehicles).\n\n3. **Full Software Ecosystem / Developer Support**: It runs on the NVIDIA JetPack SDK which includes CUDA, cuDNN, TensorRT, and the broader NVIDIA AI software stack. There's extensive developer support, documentation, and a large community. It supports multiple AI frameworks (PyTorch,","tokens":[],"id_slot":3,"stop":true,"model":"/home/bluesanta/llm/models/Qwen3.8-27B-UD-Q4_K_M.gguf","tokens_predicted":256,"tokens_evaluated":13,"generation_settings":{"seed":4294967295,"temperature":1.0,"dynatemp_range":0.0,"dynatemp_exponent":1.0,"top_k":20,"top_p":0.949999988079071,"min_p":0.0,"top_n_sigma":-1.0,"xtc_probability":0.0,"xtc_threshold":0.10000000149011612,"typical_p":1.0,"repeat_last_n":64,"repeat_penalty":1.0,"presence_penalty":0.0,"frequency_penalty":0.0,"dry_multiplier":0.0,"dry_base":1.75,"dry_allowed_length":2,"dry_penalty_last_n":64,"dry_sequence_breakers":["\n",":","\"","*"],"mirostat":0,"mirostat_tau":5.0,"mirostat_eta":0.10000000149011612,"adaptive_target":-1.0,"adaptive_decay":0.8999999761581421,"stop":[],"max_tokens":256,"n_predict":256,"n_keep":0,"n_discard":0,"ignore_eos":false,"stream":false,"logit_bias":[],"n_probs":0,"min_keep":0,"grammar":"","grammar_lazy":false,"grammar_triggers":[],"preserved_tokens":[],"chat_format":"Content-only","reasoning_format":"deepseek","reasoning_in_content":false,"generation_prompt":"","samplers":["penalties","dry","top_n_sigma","top_k","typ_p","top_p","min_p","xtc","temperature"],"speculative.types":"none,draft-mtp","timings_per_token":false,"post_sampling_probs":false,"backend_sampling":false,"lora":[]},"prompt":"Jetson AGX Orin의 장점 3가지는?","has_new_line":true,"truncated":false,"stop_type":"limit","stopping_word":"","tokens_cached":268,"timings":{"cache_n":0,"prompt_n":13,"prompt_ms":719.45,"prompt_per_token_ms":55.3423076923077,"prompt_per_second":18.069358537771908,"predicted_n":256,"predicted_ms":23792.995,"predicted_per_token_ms":93.30586274509804,"predicted_per_second":10.717440154129399,"draft_n":306,"draft_n_accepted":153}}
728x90
728x90

출처

SGLang 설치

bluesanta@gx10-3b16:~/llm$ git clone https://github.com/sgl-project/sglang.git
bluesanta@gx10-3b16:~/llm$ cd sglang

Rust 툴체인 설치

(.venv) bluesanta@gx10-3b16:~/llm/sglang$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
 
Rust is installed now. Great!
 
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).
 
To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.
 
This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish
source "~/.cargo/env.nu"  # For nushell
source "$HOME/.cargo/env.tcsh"  # For tcsh
. "$HOME/.cargo/env.ps1"        # For pwsh
source "$HOME/.cargo/env.xsh"   # For xonsh

Rust 툴체인 설치

(.venv) bluesanta@gx10-3b16:~/llm/sglang$ source $HOME/.cargo/env

SGLang Python 래퍼 설치

(.venv) bluesanta@gx10-3b16:~/llm/sglang$ pip install -e "python"

GB10 전용 커널 설치 (sglang-kernel)

(.venv) bluesanta@gx10-3b16:~/llm/sglang$ pip install sglang-kernel --index-url https://docs.sglang.io/whl/cu130 --upgrade

sglang 실행

python -m sglang.launch_server \
  --model-path /home/bluesanta/llm/models/radixArkQwen3.8-27B-NVFP4 --tp-size 1 \
  --speculative-draft-model-path /home/bluesanta/llm/models/z-labQwen3.8-27B-DFlash2 \
  --served-model-name qwen3.8-27b \
  --mem-fraction-static 0.50 \
  --attention-backend flashinfer --chunked-prefill-size 8192 \
  --disable-prefill-cuda-graph --cuda-graph-max-bs-decode 4 \
  --mamba-radix-cache-strategy extra_buffer_lazy --mamba-ssm-dtype bfloat16 \
  --max-mamba-cache-size 96 --max-running-requests 8 \
  --num-continuous-decode-steps 2 \
  --reasoning-parser qwen3 --tool-call-parser qwen3_coder \
  --api-key "bluesanta" \
  --host 0.0.0.0 --port 8000

sglang 테스트

curl http://0.0.0.0:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer bluesanta" \
  -d '{
    "model": "qwen3.8-27b",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant. Always answer in Korean."},
      {"role": "user", "content": "양자역학의 불확정성 원리에 대해 초등학생이 이해할 수 있게 짧고 쉽게 설명해줄래?"}
    ],
    "max_tokens": 1024,
    "temperature": 0.5,
    "repetition_penalty": 1.15
  }'

서비스 등록

SGLang 실행 파일 생성

bluesanta@gx10-3b16:~/llm$ vi ~/llm/start_sglang.sh

start_sglang.sh

#!/bin/bash

# 1. 가상환경 활성화
source /home/bluesanta/llm/.venv/bin/activate

# 2. SGLang 서버 실행 (OpenAI 호환 API 서버가 자동으로 켜집니다)
exec python -m sglang.launch_server \
  --model-path /home/bluesanta/llm/models/radixArkQwen3.8-27B-NVFP4 --tp-size 1 \
  --speculative-draft-model-path /home/bluesanta/llm/models/z-labQwen3.8-27B-DFlash2 \
  --served-model-name qwen3.8-27b \
  --mem-fraction-static 0.50 \
  --attention-backend flashinfer --chunked-prefill-size 8192 \
  --disable-prefill-cuda-graph --cuda-graph-max-bs-decode 4 \
  --mamba-radix-cache-strategy extra_buffer_lazy --mamba-ssm-dtype bfloat16 \
  --max-mamba-cache-size 96 --max-running-requests 8 \
  --num-continuous-decode-steps 2 \
  --reasoning-parser qwen3 --tool-call-parser qwen3_coder \
  --api-key "bluesanta" \
  --host 0.0.0.0 --port 8000

start_sglang.sh 실행 권한을 부여

(.venv) bluesanta@gx10-3b16:~/llm$ chmod +x ~/llm/start_sglang.sh

서비스 등록 파일 생성

(.venv) bluesanta@gx10-3b16:~/llm$ sudo vi /etc/systemd/system/sglang.service

vsglang.service

[Unit]
Description=SGLang API Server (Qwen3.8)
After=network.target

[Service]
User=bluesanta
WorkingDirectory=/home/bluesanta/llm
ExecStart=/home/bluesanta/llm/start_sglang.sh

Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

서비스 등록

(.venv) bluesanta@gx10-3b16:~/llm$ sudo systemctl enable sglang.service
Created symlink /etc/systemd/system/multi-user.target.wants/sglang.service → /etc/systemd/system/sglang.service.

서비스 시작

(.venv) bluesanta@gx10-3b16:~/llm$ sudo systemctl start sglang

서비스 로그 확인

(.venv) bluesanta@gx10-3b16:~/llm$ sudo journalctl -u sglang -f
728x90
728x90

출처

CUDA 버전 확인

bluesanta@gx10-3b16:~$ uname -a
Linux gx10-3b16 6.17.0-1029-nvidia #29-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul  1 00:13:52 UTC 2026 aarch64 aarch64 aarch64 GNU/Linux
bluesanta@gx10-3b16:~$ cat /etc/dgx-release
DGX_NAME="DGX Spark"
DGX_PRETTY_NAME="NVIDIA DGX Spark"
DGX_SWBUILD_DATE="2026-01-26-16-04-58"
DGX_SWBUILD_VERSION="7.4.0"
DGX_COMMIT_ID="6c74fd3"
DGX_PLATFORM="GX10"
DGX_SERIAL_NUMBER="TAMSAG002278D8C"
 
DGX_OTA_VERSION="7.5.0"
DGX_OTA_DATE="Mon May 18 23:15:23 KST 2026"
bluesanta@gx10-3b16:~$ nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv
name, compute_cap, driver_version
NVIDIA GB10, 12.1, 580.173.02
bluesanta@gx10-3b16:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Fri_May_08_10:52:52_AM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.86
Build cuda_13.2.r13.2/compiler.37953736_0

vLLM

vLLM 설치

(.venv) bluesanta@gx10-3b16:~/llm$ pip install vllm==0.27.1 --no-deps

vLLM 실행

exec /home/bluesanta/llm/.venv/bin/vllm serve /home/bluesanta/llm/models/Qwen3.8-27B-NVFP4 \
  --served-model-name qwen3.8-27b \
  --host 0.0.0.0 --port 8000 \
  --max-model-len 131072 \
  --gpu-memory-utilization 0.8 \
  --max-num-seqs 8 \
  --max-num-batched-tokens 16384 \
  --kv-cache-dtype fp8 \
  --enable-prefix-caching \
  --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' \
  --default-chat-template-kwargs '{"enable_thinking": false}' \
  --reasoning-parser qwen3 \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder \
  --limit-mm-per-prompt '{"image": 4, "video": 0}' \
  --mm-processor-cache-type shm \
  --mm-processor-kwargs '{"max_pixels": 602112, "min_pixels": 3136}'

vLLM 실행 테스트

curl -s localhost:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model":"qwen3.8-27b",
  "messages":[{"role":"user","content":"1부터 30까지 소수의 합은?"}],
  "temperature":0.6,"top_p":0.95,"top_k":20,"max_tokens":800}' \
| python3 -c "import sys,json;m=json.load(sys.stdin)['choices'][0]['message'];print('THINK:',(m.get('reasoning_content') or '')[:200]);print('ANSWER:',m.get('content'))"
(.venv) bluesanta@gx10-3b16:~/llm$ curl -s localhost:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model":"qwen3.8-27b",
  "messages":[{"role":"user","content":"한글은 누가 만들었어?"}],
  "temperature":0.6,"top_p":0.95,"top_k":20,"max_tokens":800}' | python3 -c "import sys,json;m=json.load(sys.stdin)['choices'][0]['message'];print('THINK:',(m.get('reasoning_content') or '')[:200]);print('ANSWER:',m.get('content'))"
THINK: 
ANSWER: 한글(한자음)은 **조선 제4대 왕인 세종대왕**이 주도로 제작한 문자입니다.
 
세종대왕은 백성들이 한자를 배우기 어렵다는 점을 안타깝게 여겨, 1443년(세종 25년)에 훈도(訓度)라는 이름으로 문자 제작을 명했고, 1446년(세종 28년)에 **『훈민정음』**이라는 제목으로 정식으로 반포했습니다.
 
이 문자는 과학적이고 체계적인 원리(자음의 모양이 발음 기관의 형태를 반영, 모음의 모양이 음운의 원리를 반영)에 기반하여 설계되었으며, 이후 '한글'이라는 이름으로 널리 사용되고 있습니다.

서비스 등록

vLLM 실행 파일 생성

bluesanta@gx10-3b16:~/llm$ vi ~/llm/start_vllm.sh

start_vllm.sh

#!/bin/bash

# 사용자의 기본 환경 변수 로드 (CUDA 경로 등이 .bashrc에 있다면)
# source /home/bluesanta/.bashrc

# 가상환경 활성화
source /home/bluesanta/llm/.venv/bin/activate

# vLLM 실행 (exec를 사용하여 프로세스를 대체해야 systemd가 정상적으로 PID를 추적합니다)
exec vllm serve /home/bluesanta/llm/models/Qwen3.8-27B-NVFP4 \
  --served-model-name qwen3.8-27b \
  --host 0.0.0.0 --port 8000 \
  --max-model-len 131072 \
  --gpu-memory-utilization 0.72 \
  --max-num-seqs 8 \
  --max-num-batched-tokens 16384 \
  --kv-cache-dtype fp8 \
  --enable-prefix-caching \
  --speculative-config '{"method": "mtp", "num_speculative_tokens": 2}' \
  --default-chat-template-kwargs '{"enable_thinking": false}' \
  --reasoning-parser qwen3 \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder \
  --limit-mm-per-prompt '{"image": 4, "video": 0}' \
  --mm-processor-cache-type shm \
  --mm-processor-kwargs '{"max_pixels": 602112, "min_pixels": 3136}' \
  --safetensors-load-strategy=prefetch

서비스 등록 파일 생성

bluesanta@gx10-3b16:~$ sudo vi /etc/systemd/system/vllm-qwen38.service

vllm-qwen38.service

[Unit]
Description=vLLM Qwen3.8-27B Service
After=network.target

[Service]
User=bluesanta
WorkingDirectory=/home/bluesanta/llm

# 이전에 설정한 환경 변수 파일이 있다면 주석을 해제하고 사용하세요.
# EnvironmentFile=/home/bluesanta/llm/vllm.env

# Python 대신 쉘 스크립트를 직접 실행하도록 변경
ExecStart=/home/bluesanta/llm/start_vllm.sh

Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

서비스 등록

bluesanta@gx10-3b16:~$ sudo systemctl enable vllm-qwen38.service 
Created symlink /etc/systemd/system/multi-user.target.wants/vllm-qwen38.service → /etc/systemd/system/vllm-qwen38.service.

서비스 시작

bluesanta@gx10-3b16:~$ sudo systemctl start vllm-qwen38

서비스 로그 확인

(.venv) bluesanta@gx10-3b16:~/llm$ sudo journalctl -u vllm-qwen38 -f
728x90
728x90

출처

현재 설치된 버전 확인

bluesanta@localhost:~$ dpkg -l | grep nvinfer
ii  libnvinfer-bin                                     10.16.2.10-1+cuda13.2                            arm64        TensorRT binaries
ii  libnvinfer-dev                                     10.16.2.10-1+cuda13.2                            arm64        TensorRT development libraries
ii  libnvinfer-dispatch-dev                            10.16.2.10-1+cuda13.2                            arm64        TensorRT development dispatch runtime libraries
ii  libnvinfer-dispatch10                              10.16.2.10-1+cuda13.2                            arm64        TensorRT dispatch runtime library
ii  libnvinfer-headers-dev                             10.16.2.10-1+cuda13.2                            arm64        TensorRT development headers
ii  libnvinfer-headers-plugin-dev                      10.16.2.10-1+cuda13.2                            arm64        TensorRT plugin headers
ii  libnvinfer-headers-python-plugin-dev               10.16.2.10-1+cuda13.2                            arm64        TensorRT Python plugin development headers
ii  libnvinfer-lean-dev                                10.16.2.10-1+cuda13.2                            arm64        TensorRT lean runtime libraries
ii  libnvinfer-lean10                                  10.16.2.10-1+cuda13.2                            arm64        TensorRT lean runtime library
ii  libnvinfer-plugin-dev                              10.16.2.10-1+cuda13.2                            arm64        TensorRT plugin libraries
ii  libnvinfer-plugin10                                10.16.2.10-1+cuda13.2                            arm64        TensorRT plugin libraries
ii  libnvinfer-safe-headers-dev                        10.16.2.10-1+cuda13.2                            arm64        TensorRT safety development headers
ii  libnvinfer-vc-plugin-dev                           10.16.2.10-1+cuda13.2                            arm64        TensorRT vc-plugin library
ii  libnvinfer-vc-plugin10                             10.16.2.10-1+cuda13.2                            arm64        TensorRT vc-plugin library
ii  libnvinfer10                                       10.16.2.10-1+cuda13.2                            arm64        TensorRT runtime libraries
ii  python3-libnvinfer                                 10.16.2.10-1+cuda13.2                            arm64        Python 3 bindings for TensorRT standard runtime
ii  python3-libnvinfer-dev                             10.16.2.10-1+cuda13.2                            arm64        Python 3 development package for TensorRT standard runtime
ii  python3-libnvinfer-dispatch                        10.16.2.10-1+cuda13.2                            arm64        Python 3 bindings for TensorRT dispatch runtime
ii  python3-libnvinfer-lean                            10.16.2.10-1+cuda13.2                            arm64        Python 3 bindings for TensorRT lean runtime

NVIDIA TensorRT 11.x 설치

다운로드

bluesanta@localhost:~$ wget https://developer.download.nvidia.com/compute/tensorrt/11.2.1/local_installers/nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3_1.0-1_arm64.deb

deb 로컬 리포지토리 등록

bluesanta@localhost:~$ sudo dpkg -i nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3_1.0-1_arm64.deb
Selecting previously unselected package nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3.
(Reading database ... 204342 files and directories currently installed.)
Preparing to unpack nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3_1.0-1_arm64.deb ...
Unpacking nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3 (1.0-1) ...
Setting up nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3 (1.0-1) ...
 
The public nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3 GPG key does not appear to be installed.
To install the key, run this command:
sudo cp /var/nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3/nv-tensorrt-local-019AD499-keyring.gpg /usr/share/keyrings/

GPG 키링 복사

bluesanta@localhost:~$ sudo cp /var/nv-tensorrt-local-repo-ubuntu2404-11.2.1-cuda-13.3/nv-tensorrt-local-019AD499-keyring.gpg /usr/share/keyrings/

패키지 인덱스 업데이트 및 TensorRT 11 설치

bluesanta@localhost:~$ sudo apt updateㅍ
bluesanta@localhost:~$ sudo apt remove --purge -y "libnvinfer*" "python3-libnvinfer*" "tensorrt*"
bluesanta@localhost:~$ sudo apt-get autoremove -y
bluesanta@localhost:~$ sudo apt-get install -y libnvinfer11=11.2.1.2-1+cuda13.3 libnvinfer-dev=11.2.1.2-1+cuda13.3 libnvinfer-plugin11=11.2.1.2-1+cuda13.3 libnvinfer-plugin-dev=11.2.1.2-1+cuda13.3 libnvinfer-headers-dev=11.2.1.2-1+cuda13.3 libnvinfer-headers-plugin-dev=11.2.1.2-1+cuda13.3 libnvinfer-safe-headers-dev=11.2.1.2-1+cuda13.3 libnvinfer-lean11=11.2.1.2-1+cuda13.3 libnvinfer-lean-dev=11.2.1.2-1+cuda13.3 libnvinfer-dispatch11=11.2.1.2-1+cuda13.3 libnvinfer-dispatch-dev=11.2.1.2-1+cuda13.3 libnvinfer-vc-plugin11=11.2.1.2-1+cuda13.3 libnvinfer-vc-plugin-dev=11.2.1.2-1+cuda13.3 libnvonnxparsers11=11.2.1.2-1+cuda13.3 libnvonnxparsers-dev=11.2.1.2-1+cuda13.3 python3-libnvinfer=11.2.1.2-1+cuda13.3 python3-libnvinfer-dev=11.2.1.2-1+cuda13.3 python3-libnvinfer-lean=11.2.1.2-1+cuda13.3 python3-libnvinfer-dispatch=11.2.1.2-1+cuda13.3
bluesanta@localhost:~$ dpkg -l | grep nvinfer
ii  libnvinfer-dev                                     11.2.1.2-1+cuda13.3                              arm64        TensorRT development libraries
ii  libnvinfer-dispatch-dev                            11.2.1.2-1+cuda13.3                              arm64        TensorRT development dispatch runtime libraries
ii  libnvinfer-dispatch11                              11.2.1.2-1+cuda13.3                              arm64        TensorRT dispatch runtime library
ii  libnvinfer-headers-dev                             11.2.1.2-1+cuda13.3                              arm64        TensorRT development headers
ii  libnvinfer-headers-plugin-dev                      11.2.1.2-1+cuda13.3                              arm64        TensorRT plugin headers
ii  libnvinfer-lean-dev                                11.2.1.2-1+cuda13.3                              arm64        TensorRT lean runtime libraries
ii  libnvinfer-lean11                                  11.2.1.2-1+cuda13.3                              arm64        TensorRT lean runtime library
ii  libnvinfer-plugin-dev                              11.2.1.2-1+cuda13.3                              arm64        TensorRT plugin libraries
ii  libnvinfer-plugin11                                11.2.1.2-1+cuda13.3                              arm64        TensorRT plugin libraries
ii  libnvinfer-safe-headers-dev                        11.2.1.2-1+cuda13.3                              arm64        TensorRT safety development headers
ii  libnvinfer-vc-plugin-dev                           11.2.1.2-1+cuda13.3                              arm64        TensorRT vc-plugin library
ii  libnvinfer-vc-plugin11                             11.2.1.2-1+cuda13.3                              arm64        TensorRT vc-plugin library
ii  libnvinfer11                                       11.2.1.2-1+cuda13.3                              arm64        TensorRT runtime libraries
ii  python3-libnvinfer                                 11.2.1.2-1+cuda13.3                              arm64        Python 3 bindings for TensorRT standard runtime
ii  python3-libnvinfer-dev                             11.2.1.2-1+cuda13.3                              arm64        Python 3 development package for TensorRT standard runtime
ii  python3-libnvinfer-dispatch                        11.2.1.2-1+cuda13.3                              arm64        Python 3 bindings for TensorRT dispatch runtime
ii  python3-libnvinfer-lean                            11.2.1.2-1+cuda13.3                              arm64        Python 3 bindings for TensorRT lean runtime
728x90
728x90

CUDA 버전 확인

bluesanta@localhost:~$ uname -a
Linux localhost.localdomain 6.8.12-1021-tegra #1 SMP PREEMPT Mon Jun  1 13:25:46 PDT 2026 aarch64 aarch64 aarch64 GNU/Linux
bluesanta@localhost:~$ cat /etc/nv_tegra_release
## R39 (release), REVISION: 2.0, GCID: 45755727, BOARD: generic, EABI: aarch64, DATE: Mon Jun  1 09:28:48 PM UTC 2026
## KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
bluesanta@localhost:~$ nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv
name, compute_cap, driver_version
Orin (nvgpu), 8.7, 595.78
bluesanta@localhost:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Thu_Mar_19_11:11:41_PM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.78
Build cuda_13.2.r13.2/compiler.37668154_0

빌드 도구 설치

bluesanta@localhost:~$ sudo apt update
bluesanta@localhost:~$ sudo apt install -y cmake ninja-build gcc g++ git build-essential git cmake ninja-build libopenblas-dev libopenmpi-dev openmpi-bin libatlas-base-dev libprotobuf-dev protobuf-compiler libssl-dev zlib1g-dev libffi-dev python3-pip libopenblas-dev ccache git-lfs libjpeg-dev libpng-dev libtiff-dev
bluesanta@localhost:~$ sudo apt install -y sox libsox-dev pkg-config cmake ninja-build

NCCL 설치

bluesanta@localhost:~$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/sbsa/cuda-keyring_1.1-1_all.deb
bluesanta@localhost:~$ sudo dpkg -i cuda-keyring_1.1-1_all.deb
bluesanta@localhost:~$ sudo apt update
bluesanta@localhost:~$ sudo apt install libnccl2 libnccl-dev

Python 가상 환경 생성 및 활성화

bluesanta@localhost:~$ cd llm
bluesanta@localhost:~/llm$ python -m venv .venv
bluesanta@localhost:~/llm$ source .venv/bin/activate
(.venv) bluesanta@localhost:~/llm$ python --version
Python 3.12.3
(.venv) bluesanta@localhost:~/llm$ pip install --upgrade pip

flash-attention 설치

(.venv) bluesanta@localhost:~/llm$ git clone https://github.com/flashinfer-ai/flashinfer.git
(.venv) bluesanta@localhost:~/llm$ cd flashinfer
(.venv) bluesanta@localhost:~/llm/flashinfer$ git checkout v0.6.14
(.venv) bluesanta@localhost:~/llm/flashinfer$ git submodule update --init --recursive

환경 설정

(.venv) bluesanta@localhost:~/llm/flashinfer$ export TORCH_CUDA_ARCH_LIST="8.7;8.9;9.0"
(.venv) bluesanta@localhost:~/llm/flashinfer$ export FLASHINFER_ENABLE_AOT=1

빌드

(.venv) bluesanta@localhost:~/llm/flashinfer$ python -m build --wheel

설치

(.venv) bluesanta@localhost:~/llm/flashinfer$ ls dist/
flashinfer_python-0.6.14-py3-none-any.whl
(.venv) bluesanta@localhost:~/llm/flashinfer$ pip install dist/flashinfer_python-0.6.14-py3-none-any.whl

설치 확인

test_flashinfer.py

import torch
import flashinfer

print('='*50)
print(f'✅  PyTorch 버전: {torch.__version__}')
print(f'✅  CUDA 사용 가능 여부: {torch.cuda.is_available()}')
if torch.cuda.is_available():
    print(f'✅  현재 GPU 장치: {torch.cuda.get_device_name(0)}')
    print(f'✅  PyTorch 인식 CUDA 버전: {torch.version.cuda}')

print(f'✅  FlashInfer 버전: {flashinfer.__version__}')

try:
    # 아주 간단한 FlashInfer 모듈을 호출하여 런타임 에러가 없는지 테스트
    workspace = torch.empty(32 * 1024 * 1024, dtype=torch.uint8, device='cuda:0')
    print('✅  FlashInfer CUDA 워크스페이스 할당 테스트 성공! (CUDA 완벽 지원)')
except Exception as e:
    print(f'❌  FlashInfer 동작 테스트 실패: {e}')
print('='*50)

실행

(.venv) bluesanta@localhost:~/llm$ python test_flashinfer.py 
==================================================
✅ PyTorch 버전: 2.12.0a0+git0d62256
✅ CUDA 사용 가능 여부: True
✅ 현재 GPU 장치: Orin
✅ PyTorch 인식 CUDA 버전: 13.2
✅ FlashInfer 버전: 0.6.14
✅ FlashInfer CUDA 워크스페이스 할당 테스트 성공! (CUDA 완벽 지원)
==================================================
728x90
728x90

출처

llama.cpp 설치 확인

(.venv) bluesanta@localhost:~/llm$ hf download bottlecapai/ThinkingCap-Qwen3.6-27B-GGUF --local-dir ~/llm/models/ThinkingCap-Qwen3.6-27B-GGUF

llama.cpp 설치 확인

(.venv) bluesanta@localhost:~/llm$ llama-cli -m ./models/ThinkingCap-Qwen3.6-27B-GGUF/ThinkingCap-Qwen3.6-27B-Q4_K_M.gguf -p "한글은 누가 만들었어?"
 
 
Loading model...  
 
▄▄ ▄▄
██ ██
██ ██  ▀▀█▄ ███▄███▄  ▀▀█▄    ▄████ ████▄ ████▄
██ ██ ▄█▀██ ██ ██ ██ ▄█▀██    ██    ██ ██ ██ ██
██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
                                    ██    ██
                                    ▀▀    ▀▀
 
build      : b9944-5c3a58686
model      : ./models/ThinkingCap-Qwen3.6-27B-GGUF/ThinkingCap-Qwen3.6-27B-Q4_K_M.gguf
ftype      : Q4_K - Medium
modalities : text
 
available commands:
  /exit or Ctrl+C     stop or exit
  /regen              regenerate the last response
  /clear              clear the chat history
  /read         add a text file
  /glob      add text files using globbing pattern
 
 
 
> 한글은 누가 만들었어?
 
[Start thinking]
 
We need to answer the question: "한글은 누가 만들었어?" which is Korean for "Who created Hangul?" The answer is King Sejong the Great of Joseon Dynasty. In Korean, it's "세종대왕" or "조선 세종". The question is in Korean, so the answer should be in Korean.
 
I'll respond in Korean: 한글은 조선의 세종대왕이 만들었습니다.
 
But let's make sure it's accurate. Hangul was created under the direction of King Sejong in 1443 and promulgated in 1446. So yes.
 
The user asked in Korean, so answer in Korean.
 
I'll provide a concise answer.
[End thinking]
 
한글은 조선의 **세종대왕** (1397~1450) 이 만드셨습니다.
 
세종대왕은 백성들이 글을 쉽게 배울 수 있도록 하기 위해 1443 년에 창제에 착수했으며, 1446 년 《훈민정음》이라는 명칭으로 반포하였습니다. 이는 세종대왕 혼자만의 노력으로 완성된 것이 아니라, 집현전 학자들 (장승업, 성삼문, 박팽년 등) 이 함께 연구하고 참여하여 완성된 민족의 문자입니다.
 
한글은 1997 년 유네스코 세계문화유산으로 등재되었으며, 2014 년에는 유네스코 세계기록유산으로 지정되기도 하였습니다. 🇰🇷✨
 
[ Prompt: 36.4 t/s | Generation: 7.7 t/s ]
 
> 

서비스 등록

작업 디렉토리

bbluesanta@localhost:~$ sudo mkdir -p /opt/llama.cpp
bluesanta@localhost:~$ sudo chown bluesanta:bluesanta -R /opt/llama.cpp

서비스 파일 생성

bluesanta@localhost:~$ sudo vi /etc/systemd/system/llama.service
[Unit]
Description=Llama.cpp Server Service
After=network.target

[Service]
# 사용자 계정
User=bluesanta
Group=bluesanta
LimitMEMLOCK=infinity
WorkingDirectory=/opt/llama.cpp

# 최적화된 실행 명령어
# --ctx-size 131072 -> 262144 -> 196608
# --spec-type ngram-mod,draft-mtp --spec-draft-n-max 4
ExecStart=/usr/local/bin/llama-server \
    -m /home/bluesanta/llm/models/ThinkingCap-Qwen3.6-27B-GGUF/ThinkingCap-Qwen3.6-27B-Q4_K_M.gguf \
    --mmproj /home/bluesanta/llm/models/ThinkingCap-Qwen3.6-27B-GGUF/mmproj-ThinkingCap-Qwen3.6-27B-f16.gguf \
    --host 0.0.0.0 \
    --port 8000 \
    --ctx-size 196608 \
    --n-gpu-layers 99 \
    --flash-attn on \
    --mlock \
    --cont-batching \
    --metrics \
    --image-min-tokens 1024 \
    --reasoning-preserve

# 프로세스 종료 시 자동 재시작 설정
# Restart=always
# RestartSec=5

[Install]
WantedBy=multi-user.target

서비스 등록

bluesanta@localhost:~$ sudo systemctl enable llama.service
Created symlink /etc/systemd/system/multi-user.target.wants/llama.service → /etc/systemd/system/llama.service.

서비스 갱신

bluesanta@localhost:~$ sudo systemctl daemon-reload

서비스 실행

bluesanta@localhost:~$ sudo systemctl start llama

서비스 상태 확인

bluesanta@localhost:~$ sudo systemctl status llama

서비스 로그 확인

bluesanta@localhost:~$ sudo journalctl -u llama.service -f

확인

bluesanta@localhost:~$ curl http://localhost:8000/completion -H "Content-Type: application/json" -d '{
  "prompt": "Jetson AGX Orin의 장점 3가지는?",
  "n_predict": 256
}'
{"index":0,"content":"\n\n\n\n\n\nNVIDIA Jetson AGX Orin은 현재 에지(Edge) 컴퓨팅 시장에서 가장 강력한 성능을 제공하는 AI 슈퍼컴퓨터 중 하나로, 주로 다음과 같은 3가지 핵심 장점을 가지고 있습니다.\n\n1. **압도적인 AI 성능과 높은 처리량**\n   Jetson AGX Orin은 최대 **275 TOPS**(Tera Operations Per Second)의 AI 성능을 지원하며, 이전 세대인 Xavier 대비 최대 6배 이상의 성능 향상률을 보입니다. 이는 여러 고해상도 카메라 스트림을 실시간으로 처리하거나, 복잡한 신경망을 동시에 실행하는 자율주행 로봇, 산업용 검사 시스템 등 고사양 AI 워크로드를 원활하게 처리할 수 있음을 의미합니다.\n\n2. **NVIDIA Omniverse 및 Isaac Sim과의 완벽 연동**\n   NVIDIA의 디지털 트윈 플랫폼인 **Omniverse**와 로봇 시뮬레이션 툴체인인 **Isaac Sim**과 밀접하게 통합되어 있습니다. 이를 통해 개발자는 실제 하드웨어를 구매하기 전에 가상 환경에서 AI 모델을 훈련하고 검증한 후, 동일한 아키텍처를 가진 Jetson AGX Orin으로 쉽게 배포할 수 있어 개발 주","tokens":[],"id_slot":3,"stop":true,"model":"/home/bluesanta/llm/models/ThinkingCap-Qwen3.6-27B-GGUF/ThinkingCap-Qwen3.6-27B-Q4_K_M.gguf","tokens_predicted":256,"tokens_evaluated":13,"generation_settings":{"seed":4294967295,"temperature":1.0,"dynatemp_range":0.0,"dynatemp_exponent":1.0,"top_k":20,"top_p":0.949999988079071,"min_p":0.05000000074505806,"top_n_sigma":-1.0,"xtc_probability":0.0,"xtc_threshold":0.10000000149011612,"typical_p":1.0,"repeat_last_n":64,"repeat_penalty":1.0,"presence_penalty":0.0,"frequency_penalty":0.0,"dry_multiplier":0.0,"dry_base":1.75,"dry_allowed_length":2,"dry_penalty_last_n":196608,"dry_sequence_breakers":["\n",":","\"","*"],"mirostat":0,"mirostat_tau":5.0,"mirostat_eta":0.10000000149011612,"stop":[],"max_tokens":256,"n_predict":256,"n_keep":0,"n_discard":0,"ignore_eos":false,"stream":false,"logit_bias":[],"n_probs":0,"min_keep":0,"grammar":"","grammar_lazy":false,"grammar_triggers":[],"preserved_tokens":[],"chat_format":"Content-only","reasoning_format":"deepseek","reasoning_in_content":false,"generation_prompt":"","samplers":["penalties","dry","top_n_sigma","top_k","typ_p","top_p","min_p","xtc","temperature"],"speculative.types":"none","timings_per_token":false,"post_sampling_probs":false,"backend_sampling":false,"lora":[]},"prompt":"Jetson AGX Orin의 장점 3가지는?","has_new_line":true,"truncated":false,"stop_type":"limit","stopping_word":"","tokens_cached":268,"timings":{"cache_n":0,"prompt_n":13,"prompt_ms":621.989,"prompt_per_token_ms":47.84530769230769,"prompt_per_second":20.900691169779527,"predicted_n":256,"predicted_ms":33566.852,"predicted_per_token_ms":131.120515625,"predicted_per_second":7.626571595096258}}
728x90
728x90

출처

jetpack 버전 확인

bluesanta@localhost:~$ sudo apt show nvidia-jetpack -a
Package: nvidia-jetpack
Version: 7.2-b187
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 198 kB
Depends: nvidia-jetpack-runtime (= 7.2-b187), nvidia-jetpack-dev (= 7.2-b187)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.6 kB
APT-Sources: https://repo.download.nvidia.com/jetson/common r39.2/main arm64 Packages
Description: NVIDIA Jetpack Meta Package
 
Package: nvidia-jetpack
Version: 7.2-b184
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 198 kB
Depends: nvidia-jetpack-runtime (= 7.2-b184), nvidia-jetpack-dev (= 7.2-b184)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.6 kB
APT-Sources: https://repo.download.nvidia.com/jetson/common r39.2/main arm64 Packages
Description: NVIDIA Jetpack Meta Package

CUDA 버전 확인

bluesanta@localhost:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Thu_Mar_19_11:11:41_PM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.78
Build cuda_13.2.r13.2/compiler.37668154_0

가상환경 만들기

bluesanta@bluesanta-desktop:~$ cd llm
bluesanta@localhost:~/llm$ python -m venv .venv
bluesanta@localhost:~/llm$ source .venv/bin/activate

빌드 관련 페키지 설치

(.venv) bluesanta@localhost:~/llm$ sudo apt install -y git cmake build-essential libopenblas-dev

llama.cpp 빌드

(.venv) bluesanta@localhost:~/llm$ git clone https://github.com/ggerganov/llama.cpp
(.venv) bluesanta@localhost:~/llm$ cd llama.cpp
(.venv) bluesanta@localhost:~/llm/llama.cpp$ cmake -B build -G Ninja \
  -DGGML_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES=87 \
  -DGGML_CUDA_F16=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -DGGML_NATIVE=ON \
  -DLLAMA_CURL=ON \
  -DCMAKE_C_COMPILER_LAUNCHER=ccache \
  -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
  -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
(.venv) bluesanta@localhost:~/llm/llama.cpp$ cmake --build build -j$(nproc)
(.venv) bluesanta@localhost:~/llm/llama.cpp$ sudo cmake --install build
(.venv) bluesanta@localhost:~/llm/llama.cpp$ sudo ldconfig

llama.cpp 설치 확인

(.venv) bluesanta@localhost:~/llm/llama.cpp$ llama-cli --version
version: 9944 (5c3a58686)
built with GNU 13.3.0 for Linux aarch64
bluesanta@localhost:~/llm/llama.cpp$ cd ..
bluesanta@localhost:~/llm$ llama-cli -m ./models/Qwen3.8-27B-UD-Q4_K_M.gguf --mmproj ./models/Qwen3.8-27B-mmproj-F16.gguf -p "Hello" -ngl 999 --spec-type draft-mtp
 
 
Loading model...  
 
▄▄ ▄▄
██ ██
██ ██  ▀▀█▄ ███▄███▄  ▀▀█▄    ▄████ ████▄ ████▄
██ ██ ▄█▀██ ██ ██ ██ ▄█▀██    ██    ██ ██ ██ ██
██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
                                    ██    ██
                                    ▀▀    ▀▀
 
build      : b10547-749f688fc
model      : ./models/Qwen3.8-27B-UD-Q4_K_M.gguf
ftype      : Q4_K - Medium
modalities : text, vision, video
 
available commands:
  /exit or Ctrl+C     stop or exit
  /regen              regenerate the last response
  /clear              clear the chat history
  /read         add a text file
  /glob      add text files using globbing pattern
  /image        add an image file
  /video        add a video file
 
 
 
> Hello
 
[Start thinking]
 
User said "Hello". Respond in same language (English) and ask how can help. Keep concise.
[End thinking]
 
Hello! How can I help you today?
 
[ Prompt: 47.9 t/s | Generation: 9.2 t/s ]
728x90
728x90

출처

CUDA 버전 확인

bluesanta@localhost:~$ uname -a
Linux localhost.localdomain 6.8.12-1021-tegra #1 SMP PREEMPT Mon Jun  1 13:25:46 PDT 2026 aarch64 aarch64 aarch64 GNU/Linux
bluesanta@localhost:~$ cat /etc/nv_tegra_release
## R39 (release), REVISION: 2.0, GCID: 45755727, BOARD: generic, EABI: aarch64, DATE: Mon Jun  1 09:28:48 PM UTC 2026
## KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
bluesanta@localhost:~$ nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv
name, compute_cap, driver_version
Orin (nvgpu), 8.7, 595.78
bluesanta@localhost:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Thu_Mar_19_11:11:41_PM_PDT_2026
Cuda compilation tools, release 13.2, V13.2.78
Build cuda_13.2.r13.2/compiler.37668154_0

빌드 도구 설치

bluesanta@localhost:~$ sudo apt update
bluesanta@localhost:~$ sudo apt install -y cmake ninja-build gcc g++ git build-essential git cmake ninja-build libopenblas-dev libopenmpi-dev openmpi-bin libatlas-base-dev libprotobuf-dev protobuf-compiler libssl-dev zlib1g-dev libffi-dev python3-pip libopenblas-dev ccache git-lfs libjpeg-dev libpng-dev libtiff-dev
bluesanta@localhost:~$ sudo apt install -y sox libsox-dev pkg-config cmake ninja-build

NCCL 설치

bluesanta@localhost:~$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/sbsa/cuda-keyring_1.1-1_all.deb
bluesanta@localhost:~$ sudo dpkg -i cuda-keyring_1.1-1_all.deb
bluesanta@localhost:~$ sudo apt update
bluesanta@localhost:~$ sudo apt install libnccl2 libnccl-dev

Python 가상 환경 생성 및 활성화

bluesanta@localhost:~$ cd llm
bluesanta@localhost:~/llm$ python -m venv .venv
bluesanta@localhost:~/llm$ source .venv/bin/activate
(.venv) bluesanta@localhost:~/llm$ python --version
Python 3.12.3
(.venv) bluesanta@localhost:~/llm$ pip install --upgrade pip

flash-attention 설치

(.venv) bluesanta@localhost:~/llm$ git clone https://github.com/Dao-AILab/flash-attention
(.venv) bluesanta@localhost:~/llm$ cd flash-attention
(.venv) bluesanta@localhost:~/llm/flash-attention$ git checkout v2.8.3
(.venv) bluesanta@localhost:~/llm/pytorch$ git submodule update --init --recursive

환경 설정

(.venv) bluesanta@localhost:~/llm/flash-attention$ export MAX_JOBS=4
(.venv) bluesanta@localhost:~/llm/flash-attention$ export FLASH_ATTN_CUDA_ARCHS=87

빌드

(.venv) bluesanta@localhost:~/llm/flash-attention$ python setup.py bdist_wheel
/home/bluesanta/llm/.venv/lib/python3.12/site-packages/wheel/bdist_wheel.py:4: FutureWarning: The 'wheel' package is no longer the canonical location of the 'bdist_wheel' command, and will be removed in a future release. Please update to setuptools v70.1 or later which contains an integrated version of this command.
  warn(
 
torch.__version__  = 2.12.0a0+git0d62256
 
running bdist_wheel
Guessing wheel URL:  https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.12cxx11abiTRUE-cp312-cp312-linux_aarch64.whl

설치

(.venv) bluesanta@localhost:~/llm/flash-attention$ ls dist
flash_attn-2.8.3-cp312-cp312-linux_aarch64.whl
(.venv) bluesanta@localhost:~/llm/flash-attention$ pip install dist/flash_attn-2.8.3-cp312-cp312-linux_aarch64.whl 
Processing ./dist/flash_attn-2.8.3-cp312-cp312-linux_aarch64.whl
Requirement already satisfied: torch in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from flash-attn==2.8.3) (2.12.0a0+git0d62256)
Requirement already satisfied: einops in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from flash-attn==2.8.3) (0.8.2)
Requirement already satisfied: filelock in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (3.29.6)
Requirement already satisfied: typing-extensions>=4.10.0 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (4.16.0)
Requirement already satisfied: setuptools<82 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (80.10.2)
Requirement already satisfied: sympy>=1.13.3 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (1.14.0)
Requirement already satisfied: networkx>=2.5.1 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (3.6.1)
Requirement already satisfied: jinja2 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (3.1.6)
Requirement already satisfied: fsspec>=0.8.5 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from torch->flash-attn==2.8.3) (2026.6.0)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from sympy>=1.13.3->torch->flash-attn==2.8.3) (1.3.0)
Requirement already satisfied: MarkupSafe>=2.0 in /home/bluesanta/llm/.venv/lib/python3.12/site-packages (from jinja2->torch->flash-attn==2.8.3) (3.0.3)
Installing collected packages: flash-attn
Successfully installed flash-attn-2.8.3

설치 확인

test_flash_attn.py

import torch
from flash_attn import flash_attn_func

# 检查 PyTorch 的 CUDA 架构支持,这是关键的一步
print(f"PyTorch 编译时支持的 CUDA 架构: {torch.cuda.get_arch_list()}")

# 创建一个简单的测试用例
batch_size, seq_len, num_heads, head_dim = 2, 128, 8, 64
q = torch.randn(batch_size, seq_len, num_heads, head_dim, dtype=torch.float16, device='cuda')
k = torch.randn(batch_size, seq_len, num_heads, head_dim, dtype=torch.float16, device='cuda')
v = torch.randn(batch_size, seq_len, num_heads, head_dim, dtype=torch.float16, device='cuda')

# 执行 Flash Attention 函数
output = flash_attn_func(q, k, v)
print(f"测试成功!输出张量形状: {output.shape}")

실행

(.venv) bluesanta@localhost:~/llm$ python test_flash_attn.py
PyTorch 编译时支持的 CUDA 架构: ['sm_87']
测试成功!输出张量形状: torch.Size([2, 128, 8, 64])
728x90

+ Recent posts