ubuntu 24.04 用 NetworkManager 來設定 網路相關功能。
所以都用 nmcli 做,不用像以前要設定 iptable, dnsmasq..
所以都會出現在 /etc/netplan/***.yaml
每個 network 設定都會再 /etc/netplan/ 下留下一個紀錄。
曾經發生過 設定 ipv4 share 的 NIC,device 無法正確 forward 出去。
network setting 在usb-network多出一個Setting,
之後把/etc/netplan/ 下沒用到的,不正確的 yaml 刪除重新開機後,好像就正常了。
2025/5/19
2025/5/14
DMAR error, intel_iommu
apt update 後,到 UI 的 Software Updater 去更新,其實只有選把nouse 的 remove,結果更新後,第二螢幕變白。
重開機後卡在開機 splash,因為以前有出現過,所以把第二螢幕移除,重開機後 OK,在接上外接螢幕,外接螢幕白色。
看 dmesg 有一堆:
據說那個error 是 write access right 沒有set。
重開機後卡在開機 splash,因為以前有出現過,所以把第二螢幕移除,重開機後 OK,在接上外接螢幕,外接螢幕白色。
看 dmesg 有一堆:
DMAR: [DMA Read NO_PASID] Request device [04:00.0] fault addr 0xff62e000 [fault reason 0x06] PTE Read access is not set [19704.235699] DMAR: DRHD: handling fault status reg 3 ...所以google 一下,都說是這樣: 就是修改 /etc/default/grub..
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=off"然後更新
update-grub之後重開機就正常了。
據說那個error 是 write access right 沒有set。
2025/5/10
Upgrade Node to 20.X --- for copilot in vim
ref:
ubuntu 24.04 的 nodee 版本是 18。copilot for vim 要 20.X,
所以要手動 upgrade. ref: 大概就是先 remove nodejs…然後 run
裝完是 20.19
進入 vi 後
要先 authenticate..
告訴它
about node and nodejs
基本都是 nodejs 這個 package 安裝的,node 會安裝在 /usr/bin/node,/usr/bin/nodejs
曾經發生 node, nodejs 版本不一致,發現node 被裝在 /usr/local/bin/,所以沒有 uninstall,把它刪掉就可以。
官方的install script。
nodejs.org 的安裝說明,一定要選 nvm, fnm 或 docker,而且安裝 script 不需要 sudo.
因為 node,js 可以完全 install locally,也就是裝在自己 home 的 .nvm 下,
然後用 nvm 來安裝特定版本的node.
之後就可以用 node 了(只有你自己可以用,因為是裝在你的 home)
npm install -g package 就會裝在你自己home的 .nvm/.../node/...
因為都是在自己的目錄,就沒有權限問題。
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - sudo apt-get install -y nodejs
ubuntu 24.04 的 nodee 版本是 18。copilot for vim 要 20.X,
所以要手動 upgrade. ref: 大概就是先 remove nodejs…然後 run
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -然後再 apt install nodejs
裝完是 20.19
進入 vi 後
:Copilot help會 show copilot command,就是 copilot.txt。
要先 authenticate..
:Copilot setup果然不知道怎麽用...
告訴它
:set filetype=c看狀態
:Copilot status
about node and nodejs
基本都是 nodejs 這個 package 安裝的,node 會安裝在 /usr/bin/node,/usr/bin/nodejs
曾經發生 node, nodejs 版本不一致,發現node 被裝在 /usr/local/bin/,所以沒有 uninstall,把它刪掉就可以。
官方的install script。
nodejs.org 的安裝說明,一定要選 nvm, fnm 或 docker,而且安裝 script 不需要 sudo.
因為 node,js 可以完全 install locally,也就是裝在自己 home 的 .nvm 下,
然後用 nvm 來安裝特定版本的node.
之後就可以用 node 了(只有你自己可以用,因為是裝在你的 home)
npm install -g package 就會裝在你自己home的 .nvm/.../node/...
因為都是在自己的目錄,就沒有權限問題。
2025/5/8
DeepWiki Open
所以步驟大概是這樣。
如果不是要 run 在 local,在 Server 上
啟動 backend
因為支援 local folder,所以可以去 server clone repo,然後在 project 位置填絕對 path.
勾 Local Ollama Model (Experimental)
就可以開始 Generate Wiki
他使用的 ollama model 寫在 api/config.py,可以自己修改。
如果不是要 run 在 local,在 Server 上
git clone https://github.com/AsyncFuncAI/deepwiki-open.git參考上一篇,修改 NEXT_PUBLIC_SERVER_BASE_URL 到 server 的 public ip address.
啟動 backend
pip install -r api/requirements.txt python -m api.main啟動 front-end
npm install npm run dev -- -H 0.0.0.0然後就可以開啟 http://server-ip:3000
因為支援 local folder,所以可以去 server clone repo,然後在 project 位置填絕對 path.
勾 Local Ollama Model (Experimental)
就可以開始 Generate Wiki
他使用的 ollama model 寫在 api/config.py,可以自己修改。
2025/5/3
亂記一些
這邊是有關 deepwiki-open:
從Dockerfil 看到 python 是 3.11
python 啟動的是 backend server,用 npm run 啟動的是 fron-end.
fron end 原來 listen on localhost,用 npm run 的 command:
使用 docker compose up 的話,使用 ollam 時,要修改:
原來他的 front-end, ts code,連到 localhost,所以是連到 browser 所在主機的 localhost,不是 server ...
所以要 修改 client side 的 SERVER_BASE_URL,用 server 的 ip:
更新後發現支援 local path,所以就 clone 到 local disk 後再給 path 就可以。
這邊的 local 又變成 server 的 local,不是 browser 的 local。
所以都要在 run 的那台 server 上clone source 之後,給 full path.
還有今天apt update/upgrade 後,lcd backlight 又失效了。
然後進入additional driver 設定想換 driver 出現 Error。
要反悔又不行。
一直出現 要 apt --fix-broken install
但是又會出現 overwrite error /var/.../*.deb,
所以只好 follow stackoverflow 說明,用 apt -i --force-overwrite /var/..../*.deb 來強制 install
去看這個是 folder ,所以無法 overwrite,rename 後就可以了,然後那個 deb 就 create 了一個同名 file。
繼續 apt fix,出現 error,照次說 sandboxutils-filelist.json 無法 rmdif,--- 因為他是 file 呀!
所以就去把 file 刪掉,把剛剛rename 的 folder rename 回來。
才完成 fix
查 sandboxutils-filelist.json 目錄下有一個同名檔案,他的內容跟 file 的內容是一致的。
髓以我猜某一個 deb 稿錯了。
然後剛剛又 apt update, apt list --upgradable 看到 cuda-driver 有更新 575....
所以是更新成 575 造成 ? 還是要更新 575 才會 fix ?
要用 transformer run phi4-multimodal 要 install flash-attention:
另外還要:
enable conda in powershell,要 run
從Dockerfil 看到 python 是 3.11
python 啟動的是 backend server,用 npm run 啟動的是 fron-end.
fron end 原來 listen on localhost,用 npm run 的 command:
npm run dev -- -H 0.0.0.0就可以改到 public ip
使用 docker compose up 的話,使用 ollam 時,要修改:
diff --git a/docker-compose.yml b/docker-compose.yml
index a7d42c3..b1d85d3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,6 +3,7 @@ version: '3.8'
services:
deepwiki:
build: .
+ network_mode: host
ports:
- "${PORT:-8001}:${PORT:-8001}" # API port
- "3000:3000" # Next.js port
把 contrainer 的 localhost:11434 使用 host 的,才能跟 ollama 連接。原來他的 front-end, ts code,連到 localhost,所以是連到 browser 所在主機的 localhost,不是 server ...
所以要 修改 client side 的 SERVER_BASE_URL,用 server 的 ip:
diff --git a/docker-compose.yml b/docker-compose.yml
index a7d42c3..210e476 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,6 +3,7 @@ version: '3.8'
services:
deepwiki:
build: .
ports:
- "${PORT:-8001}:${PORT:-8001}" # API port
- "3000:3000" # Next.js port
@@ -11,6 +12,6 @@ services:
environment:
- PORT=${PORT:-8001}
- NODE_ENV=production
- - NEXT_PUBLIC_SERVER_BASE_URL=http://localhost:${PORT:-8001}
+ - NEXT_PUBLIC_SERVER_BASE_URL=http://192.168.145.77:${PORT:-8001}
volumes:
- ~/.adalflow:/root/.adalflow # Persist repository and embedding data
發現沒辦法support gitlab 的 subgroup,因為會和產生的 page 的 path 混在一起,而 source code 的result http server 頁面是依照source path 安排的。更新後發現支援 local path,所以就 clone 到 local disk 後再給 path 就可以。
這邊的 local 又變成 server 的 local,不是 browser 的 local。
所以都要在 run 的那台 server 上clone source 之後,給 full path.
- DeepWiki opensource implement
- huggingface agent : smolagents, E2B Desktop, Qwen2-VL-72B-Instruct
- LTX-Video : ComfyUI
- uv
- microsoft pi4 cookbook, speech transcribe
- huggingface phi4 multimodel example
- phi 4 multimodal toturial
還有今天apt update/upgrade 後,lcd backlight 又失效了。
然後進入additional driver 設定想換 driver 出現 Error。
要反悔又不行。
一直出現 要 apt --fix-broken install
但是又會出現 overwrite error /var/.../*.deb,
所以只好 follow stackoverflow 說明,用 apt -i --force-overwrite /var/..../*.deb 來強制 install
sudo dpkg --force-overwrite /var/cache/apt/archives/libnvidia-common-570-server_570.133.20-0ubuntu0.24.04.1_all.deb最後還是 fail 因為unpack 某個 deb 出現 /usr/share/nvidia/files.d/sandboxutils-filelist.json 無法overwrite,
去看這個是 folder ,所以無法 overwrite,rename 後就可以了,然後那個 deb 就 create 了一個同名 file。
繼續 apt fix,出現 error,照次說 sandboxutils-filelist.json 無法 rmdif,--- 因為他是 file 呀!
所以就去把 file 刪掉,把剛剛rename 的 folder rename 回來。
才完成 fix
查 sandboxutils-filelist.json 目錄下有一個同名檔案,他的內容跟 file 的內容是一致的。
髓以我猜某一個 deb 稿錯了。
然後剛剛又 apt update, apt list --upgradable 看到 cuda-driver 有更新 575....
所以是更新成 575 造成 ? 還是要更新 575 才會 fix ?
要用 transformer run phi4-multimodal 要 install flash-attention:
pip install flash-attn --no-build-isolation然後會用 cicc build 很久...
另外還要:
soundfile peft backoff結果phi4-multimodal 太大... 超過 24G..
enable conda in powershell,要 run
PS C:\Users\charles.chang> conda init powershell no change D:\miniconda\Scripts\conda.exe no change D:\miniconda\Scripts\conda-env.exe no change D:\miniconda\Scripts\conda-script.py no change D:\miniconda\Scripts\conda-env-script.py no change D:\miniconda\condabin\conda.bat no change D:\miniconda\Library\bin\conda.bat no change D:\miniconda\condabin\_conda_activate.bat no change D:\miniconda\condabin\rename_tmp.bat no change D:\miniconda\condabin\conda_auto_activate.bat no change D:\miniconda\condabin\conda_hook.bat no change D:\miniconda\Scripts\activate.bat no change D:\miniconda\condabin\activate.bat no change D:\miniconda\condabin\deactivate.bat modified D:\miniconda\Scripts\activate modified D:\miniconda\Scripts\deactivate modified D:\miniconda\etc\profile.d\conda.sh modified D:\miniconda\etc\fish\conf.d\conda.fish no change D:\miniconda\shell\condabin\Conda.psm1 modified D:\miniconda\shell\condabin\conda-hook.ps1 no change D:\miniconda\Lib\site-packages\xontrib\conda.xsh modified D:\miniconda\etc\profile.d\conda.csh modified D:\OneDrive\OneDrive - Royaltek\文件\WindowsPowerShell\profile.ps1 ==> For changes to take effect, close and re-open your current shell. <==
2025/4/15
RK3588 MP520
black 在 pchome 買的 rk3588 板子。
打開蓋子有 maskrom button,所以一樣可以 boot to maskrom
然後 rkdevtool 看得到。
但是官方沒有提供 image file,所以不敢亂燒。
看論壇說 kernel source 是用 apt-get source 的方式提供的,但是我只有找到 dtb 和 header. 沒有source (GPL...疑慮)
只好用預燒的 image 開機,是 debian.
UI 還好算流暢,不會像 pi 用 gui 那樣很頓。
可以用 chromium 看 youtub, hd OK, 4k 會卡,然後 cpu 超熱 (沒有使用 hardware codec ?)
用 top 看有一個 pipewire process 一直吃掉一個核...
因為不能動image,也沒有 uboot, kernel source,所以只好試試看 npu。
follow : ArmSoM Wiki: rknn-sdk
照著做,啟動 rknn_server 之後,把 *.rknn 轉好 scp 過去。
然後run:
發生 ssh 連線中斷問題,好像進入 suspend 了...
所以只好把所有 systemd 的 suspend service 關掉。
--- 關掉一堆,所以不知道真正有效是哪個。所以沒記。
about source code
ref: MP-520更新發生錯誤
about system image
ref: MP520-20 請問有官方 image 的下載點嗎?
或是把 nvme ssd 接到 pc 來 DD 備份。
...不曉得有甚麼難處,不然找個 googledrive, mega 之類的放也可以,買的人沒很多,要 download 的人也不會很多吧。
可能 image 不是他們自己 build,他們沒有軟體工程師...
打開蓋子有 maskrom button,所以一樣可以 boot to maskrom
然後 rkdevtool 看得到。
但是官方沒有提供 image file,所以不敢亂燒。
看論壇說 kernel source 是用 apt-get source 的方式提供的,但是我只有找到 dtb 和 header. 沒有source (GPL...疑慮)
只好用預燒的 image 開機,是 debian.
UI 還好算流暢,不會像 pi 用 gui 那樣很頓。
可以用 chromium 看 youtub, hd OK, 4k 會卡,然後 cpu 超熱 (沒有使用 hardware codec ?)
用 top 看有一個 pipewire process 一直吃掉一個核...
因為不能動image,也沒有 uboot, kernel source,所以只好試試看 npu。
follow : ArmSoM Wiki: rknn-sdk
one@MB127:~$ dmesg | grep -i rknpu ... [ 4.532693] [drm] Initialized rknpu 0.9.6 20240322 for fdab0000.npu on minor 1所以 kernel 有 enable rknpu
照著做,啟動 rknn_server 之後,把 *.rknn 轉好 scp 過去。
然後run:
(toolkit2) one@MB127:~/projects/rknn_model_zoo/examples/yolov5/python$ python yolov5.py --model_path ~/yolov5s_relu.onnx --img_show use anchors from '../model/anchors_yolov5.txt', which is [[[10.0, 13.0], [16.0, 30.0], [33.0, 23.0]], [[30.0, 61.0], [62.0, 45.0], [59.0, 119.0]], [[116.0, 90.0], [156.0, 198.0], [373.0, 326.0]]] /home/one/projects/rknn_model_zoo/py_utils/onnx_executor.py:12: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. if getattr(np, 'bool', False): Model-/home/one/yolov5s_relu.onnx is onnx model, starting val infer 1/1 IMG: bus.jpg person @ (208 242 286 508) 0.881 person @ (478 238 560 525) 0.859 person @ (109 237 232 534) 0.842 person @ (79 355 121 515) 0.318 bus @ (91 129 555 465) 0.702
發生 ssh 連線中斷問題,好像進入 suspend 了...
[ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: Link is Down [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: FPE workqueue stop [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: Register MEM_TYPE_PAGE_POOL RxQ-0 [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: PHY [stmmac-1:01] driver [YT8531 Gigabit Ethernet] (irq=POLL) [ 4? 15 16:59:14 2025] dwmac4: Master AXI performs any burst length [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: No Safety Features support found [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: registered PTP clock [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: FPE workqueue start [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: configuring for phy/rgmii-rxid link mode [ 4? 15 16:59:14 2025] rk_gmac-dwmac fe1c0000.ethernet end1: FPE workqueue stop [ 4? 15 16:59:15 2025] PM: suspend entry (deep) [ 4? 15 16:59:15 2025] Filesystems sync: 0.015 seconds大概是no activity suspend,雖然有去 settings 確認關掉,但是還是沒用。
所以只好把所有 systemd 的 suspend service 關掉。
--- 關掉一堆,所以不知道真正有效是哪個。所以沒記。
about source code
ref: MP-520更新發生錯誤
關於MP520 Linux kernel版本的說明: 目前MP520採用的Linux kernel為SoC RK3588S原廠提供的版本加以修改成適合MP520主機板。RK3588S原廠推出新版的速度很慢。 我們會將原廠版本經過修改,並在每一滾動發行版中徹底測試再發佈出來。 另外開源界主流的Mainline linux kernel已有RK3588S版本,但是還只限於終端機文字模式,還很陽春,無法支援圖形視窗介面。 等到Mainline linux kernel的RK3588S版本可以支援圖形視窗時,MP520的Kernel,計劃從Mainline Kernel版本修改而成。 這樣就可以隨時保持最新版本了。不過估計至少還需要一、兩年以上的時間。
about system image
ref: MP520-20 請問有官方 image 的下載點嗎?
沒有,但是提供刷機服務沒有 sourcecode,也沒有 image,所以只能買一個 nvme ssd 來換了,以免郵寄麻煩..
或是把 nvme ssd 接到 pc 來 DD 備份。
...不曉得有甚麼難處,不然找個 googledrive, mega 之類的放也可以,買的人沒很多,要 download 的人也不會很多吧。
可能 image 不是他們自己 build,他們沒有軟體工程師...
2025/4/12
隨便的 memo ...
沒 train 完的 yolo3,用 coco dataset 來試試看。
-- convert coco to pascal_voc format:
所以 自己去 annotations 找 filename.txt,
到 JPEGImages 找 filename.jpg
要分 train 和 validate。
coco dataset 的format:
一個 imagefolder 配一個 json,裡面有 folder 所有的 image 和 labels
datasets 的format 現在大概有三種
dataloader( ) 中,參數是 filename list. txt 檔的 path,image folder path,label folder path
所以不用依照pascal_voc 的方式,只要 image,label 分開 folder放就可以。
這個: 說的 "YOLODataset" 就是哪個用空白格開的文字檔 (csv with space)
然後 folder 要依照
還是專業的厲害,叫 gemma3:27b 從 dataset.py 找出 train.csv 的格式是什麼,一直鬼打牆說 train.csv 找不到。
換成 github copilot + sonnect 3.5,同樣的 prompt 就回答了(只是不知道鄭不正確):
據原始論文說是因為 2014 公佈時,object detection 只有這 80個,另外 10 個是 segmentation 的。
我照著說明,修改在這裡
他自己做好的 5k.part 是 ascii file,裡面是 image file 的 list
哪個 labels.tgz 其實是 tar,沒有gz
解開就是 YOLO 的 label 格式 txt,每個 image 都有一個。
-- convert coco to pascal_voc format:
pascal_voc/
├── VOC2012/
│ ├── Annotations/ # XML annotation files
│ ├── ImageSets/
│ │ └── Main/
│ │ └── train.txt # Training image names
│ └── JPEGImages/ # Image files (.jpg)
│
└── VOC2007/
├── Annotations/ # XML annotation files
├── ImageSets/
│ └── Main/
│ └── test.txt # Testing image names
└── JPEGImages/ # Image files (.jpg)
train.txt 是 filename list.所以 自己去 annotations 找 filename.txt,
到 JPEGImages 找 filename.jpg
要分 train 和 validate。
coco dataset 的format:
一個 imagefolder 配一個 json,裡面有 folder 所有的 image 和 labels
datasets 的format 現在大概有三種
- pascal_voc
- coco
- ultralytic yolo
dataloader( ) 中,參數是 filename list. txt 檔的 path,image folder path,label folder path
所以不用依照pascal_voc 的方式,只要 image,label 分開 folder放就可以。
這個: 說的 "YOLODataset" 就是哪個用空白格開的文字檔 (csv with space)
然後 folder 要依照
.
├── images
│ ├── train
│ └── val
└── labels
├── train
└── val
好像有一個 filelist ..還是專業的厲害,叫 gemma3:27b 從 dataset.py 找出 train.csv 的格式是什麼,一直鬼打牆說 train.csv 找不到。
換成 github copilot + sonnect 3.5,同樣的 prompt 就回答了(只是不知道鄭不正確):
Based on the code in dataset.py, I can explain how the train.csv file should be structured. The file is used to map image names to their corresponding label files.
The train.csv should contain two columns:
1. Image filename
2. Label filename
Here's an example of how train.csv should look:
```csv
image_name,label_name
image1.jpg,image1.txt
image2.jpg,image2.txt
dog_picture.jpg,dog_picture.txt
car_street.jpg,car_street.txt
```
Key points about the CSV structure:
- The image filenames should correspond to files in the `COCO/images/images/` directory
- The label filenames should correspond to files in the `COCO/labels/labels_new/` directory
- Each label file (.txt) contains the bounding box information in the format: <class_label> <x> <y> <width> <height&ht;`
You can create this CSV file using a simple Python script like this:
````python
import os
import pandas as pd
def create_train_csv(image_dir, label_dir, output_csv):
image_files = [f for f in os.listdir(image_dir) if f.endswith(('.jpg', '.jpeg', '.png'))]
data = []
for img_file in image_files:
# Assume label file has same name but .txt extension
label_file = os.path.splitext(img_file)[0] + '.txt'
if os.path.exists(os.path.join(label_dir, label_file)):
data.append([img_file, label_file])
df = pd.DataFrame(data, columns=['image_name', 'label_name'])
df.to_csv(output_csv, index=False)
# Example usage
create_train_csv(
'COCO/images/images/',
'COCO/labels/labels_new/',
'COCO/train.csv'
)
````
This script will:
1. Scan the images directory
2. Match image files with their corresponding label files
3. Create a CSV file with the correct format expected by the YOLODataset class
The dataset class then uses this CSV file to load the corresponding image and label pairs during training.
然後 COCO dataset 的 annotation 中 class (category 會到 90),但是只有列出 80 個。據原始論文說是因為 2014 公佈時,object detection 只有這 80個,另外 10 個是 segmentation 的。
我照著說明,修改在這裡
他自己做好的 5k.part 是 ascii file,裡面是 image file 的 list
... /images/val2014/COCO_val2014_000000581827.jpg /images/val2014/COCO_val2014_000000581829.jpg ...剛好有 5000 個 file
哪個 labels.tgz 其實是 tar,沒有gz
解開就是 YOLO 的 label 格式 txt,每個 image 都有一個。
訂閱:
文章 (Atom)