torchmetrics下載安裝

torchmetrics下載安裝
torchmetrics下載安裝

安裝『Stable Diffusion』時未有裝『torchmetrics』.

ImportError: cannot import name ‘_compare_version’ from ‘torchmetrics.utilities.imports’ (C:\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\utilities\imports.py)

進入『命令行模式CMD

查版本號

pip show torchmetrics

缷載

pip uninstall torchmetrics

下載0.11.4版本

C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install torchmetrics==0.11.4

 

httpx下載安裝

httpx下載安裝
httpx下載安裝

安裝『Stable Diffusion』時報錯

TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument ‘socket_options’
  1. 進入『命令行模式CMD
  2. 執行下列安裝指令
C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install httpx==0.24.1 -force-reinstall
python.exe -m pip install httpx==0.24.1 -force-reinstall

 

 

 

OpenCLIP下載安裝

OpenCLIP下載安裝
OpenCLIP下載安裝

安裝『Stable Diffusion』時未裝『open_clip』. 其實亦係『clip

RuntimeError: Couldn’t install open_clip.

進入『open_clip

https://github.com/mlfoundations/open_clip

或者下載『open_clip』落『C:』碟

git clone https://github.com/openai/open_clip.git

下載『open_clip-main.zip』後解壓本地安裝

https://codeload.github.com/mlfoundations/open_clip/zip/refs/heads/main

复制『C:\open_clip』到『C:\stable-diffusion-webui\venv\Scripts』

C:\open_clip Sour
C:\stable-diffusion-webui\venv\Scripts dest

進入『命令行模式CMD

CD去『CLIP』檔䅁夾, 作為本地路徑

cd C:\stable-diffusion-webui\venv\Scripts\open_clip

执行下列安裝指令

C:\stable-diffusion-webui\venv\Scripts\python.exe setup.py build install

 

常試通過pip指令安裝

pip install open_clip_torch

 

NVIDIA RTX孖2080Ti-組NVLink

NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX孖2080Ti-組NVLink
NVIDIA RTX 2080Ti NVLink Nvidia-smi
NVIDIA RTX 2080Ti NVLink Nvidia-smi
552.22-desktop-win10-win11-64bit-international-nsd-dch-whql
552.22-desktop-win10-win11-64bit-international-nsd-dch-whql
NVLinkTest
NVLinkTest

諗住買3090Ti點知連成萬,孖2080Ti送NVLink先陸千有找.

登入NVIDIA官網下載嘉時至新驅動

https://www.nvidia.com/Download/index.aspx?lang=en-us

 

NVIDIA Driver Downloads
NVIDIA Driver Downloads
Product Type GeForce
Product Series GeForce RTX 40 Series
Product GeForce RTX 4090 Ti
Operating System Windows 10 64-bit
Download Type NVIDIA Studio Driver

撳Search下載驅動

https://us.download.nvidia.com/Windows/552.22/552.22-desktop-win10-win11-64bit-international-nsd-dch-whql.exe
  1. 登入『命令列介面cmd』.
  2. 撳『nvidia-smi
  3. 睇到孖『NVIDIA GeForce RTX 2080 Ti』

 

新顯卡NVLINK金手指有封膜,撕左插入NVLINK桥即掂.冇使搞BIOS.

  1. 撳『NVIDIA控制面板』
  2. 撳『3D設定』->『設定SLI,Surround,PhysX』->『SLI設定』
  3. 勾『最大3D效能』

 

下載『NVLinkTestCUDA11』測試NVLINK桥造總線带寛

https://www.pugetsystems.com/support/guides/how-to-enable-and-test-nvidia-nvlink-on-quadro-and-geforce-rtx-cards-in-windows-10-1266/
https://puget.systems/go/NVLinkTestCUDA11

孖『NVIDIA GeForce RTX 2080 Ti』都插係PCIEx16,鋪頭送『GeForce NVLINK』桥造總線带寛得『48.08GB/S』, 可能要『Quadro Nvlink』先有『100GB/S』带寛.

Clip下載安裝

Clip下載安裝
Clip下載安裝
Clip下載安裝
Clip下載安裝

clip』建构圖像文字之間連系模型,安裝『Stable Diffusion』時未有安裝『clip』.

RuntimeError: Couldn’t install clip.

進入『clip

https://github.com/openai/clip/

下載『clip』落『C:』碟

git clone https://github.com/openai/CLIP.git

或者下載『CLIP-main.zip』後解壓

https://codeload.github.com/openai/CLIP/zip/refs/heads/main

复制『C:\CLIP』到『C:\stable-diffusion-webui\venv\Scripts』

C:\CLIP Sour
C:\stable-diffusion-webui\venv\Scripts dest

進入『命令行模式CMD

CD去『CLIP』檔䅁夾, 作為本地路徑

cd C:\stable-diffusion-webui\venv\Scripts\CLIP

执行下列安裝指令

C:\stable-diffusion-webui\venv\Scripts\python.exe setup.py build install

 

GFPGAN下載安裝

gfpgan下載安裝
gfpgan下載安裝

安裝『Stable Diffusion』時未有安裝『gfpgan』人樣修复.

RuntimeError: Couldn’t install gfpgan.

進入『GFPGAN

https://github.com/TencentARC/GFPGAN

下載『GFPGAN』落『C:』碟

git clone https://github.com/TencentARC/GFPGAN.git

复制『C:\GFPGAN』到『C:\stable-diffusion-webui\venv\Scripts』

C:\GFPGAN Sour
C:\stable-diffusion-webui\venv\Scripts dest

進入『命令行模式CMD

CD去『GFPGAN』檔䅁夾, 作為本地路徑

cd C:\stable-diffusion-webui\venv\Scripts\GFPGAN

执行下列安裝指令

C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install basicsr
C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install facexlib
C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install -r requirements.txt
C:\stable-diffusion-webui\venv\Scripts\python.exe setup.py develop
C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install realesrgan

 

PyTorch下載安裝

PyTorch下載安裝
PyTorch下載安裝
PyTorch下載安裝
PyTorch下載安裝

『Torch』基於神經網络人工智慧輵, 『PyTorch』係『Python』版本

首先确認NVIDIA顯卡支持CUDA版本. 下載最新顯卡驅動『552.22-desktop-win10-win11-64bit-international-nsd-dch-whql.exe』

 

網络安装『PyTorch

  1. 進『命令行模式CMD
pip3 install torch torchvision torchaudio –index-url https://download.pytorch.org/whl/cu121

 

本地安装『PyTorch

  1. 進『命令行模式CMD
  2. 行『NVIDIA-SMI.exe
  3. 确認『torch版』+『cuda版』+『python版』+『win/linux版』
  4. 部機『torch-2.3.0』+『cuda-12.4』+『python-3.10.6』+ 『Win-x64』
  5. 版本配對『cp=python』,『cu<=cuda』
https://download.pytorch.org/whl/torch/
  1. 直接将『.whl』下載落蒞直接本地安裝『torch-2.3.0+cu121-cp310-cp310-win_amd64.whl
https://download.pytorch.org/whl/cu121/torch-2.3.0%2Bcu121-cp310-cp310-win_amd64.whl#sha256=002027d18a9c054f08fe9cf7a729e041229e783e065a71349015dcccc9a7137e
  1. 將『.whl』摆係『D:』碟.
  2. 管現員身份進入命令行模式cmd
  3. 『pip install whl “d:\torch-2.3.0+cu121-cp310-cp310-win_amd64.whl”』
  4. 檢查最新版pip時出錯.
WARNING:There was an error checking the latest version of pip.
  1. 管現員身份進入命令行模式cmd
Defaulting to user installation because normal site-packages is not writeable
  1. 手動升級pip至最新版. 以管理員身份𢴇行.
python -m pip install –upgrade pip

測試『Pytorch』返回true,表示可調用GPU-CUDA指令, 進入『Pytho3.10』.

import torch
print(torch.__version__)
torch.cuda.is_available()

 

缷載tcrch

Pip uninstall torch
Pip uninstall torchaudio torchvision
Pip uninstall torch-geometric torch-scatter torch-sparse torch-cluster torch-spline-conv

 

https://pytorch.org/get-started/locally/
https://pytorch.org/get-started/previous-versions/

 

NVIDIA TESLA P40

NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40
NVIDIA TESLA P40 GPU REGEDIT
NVIDIA TESLA P40 GPU REGEDIT
NVIDIA TESLA P40 GPU
NVIDIA TESLA P40 GPU
NVIDIA TESLA P40 GPUZ
NVIDIA TESLA P40 GPUZ
NVIDIA TESLA P40 NVIDIA-SMI
NVIDIA TESLA P40 NVIDIA-SMI
NVIDIA TESLA P40 NVIDIA GPU
NVIDIA TESLA P40 NVIDIA GPU
NVIDIA TESLA P40 NVIDIA GPU
NVIDIA TESLA P40 NVIDIA GPU

睇人AI繪畫,諗住買NVIDIA顯卡,中古RTX3060都要兩千幾,

可能係機房大批淘汰,Tesla P40-24GB係網大量焦拋售,柒百伍包郵,成色麻麻.配NVIDIA-8pin專用供電線,睇佢散熱槽,應該係風道式散熱. 係屎窟裝涡輪風扇, 點知電流大噪䡰大,再加30%降壓線壓低風.

 

使能PCIE-Above 4G

  1. 著機撳DEL鍵,BIOS
  2. ENABLED PCIE-Above 4G

 

驅動下載

  1. 登入https://www.nvidia.com/Download/index.aspx?lang=en-us
填NVIDIA Driver Downloads
NVIDIA Driver Downloads
Product Type Data Center Tesla
Product Series P-Series
Product Tesla P40
Operating System Windows 10 64-bit
  1. 撳Search
  2. 下載『33-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe
  3. 重裝『Quadro K6000』驅動會自動裝埋『Tesla P40』
  4. 登入『命令行界面cmd』.
  5. 撳『nvidia-smi
  6. 分別係『Tesla P40』『Quadro K6000

 

『Tesla P40』裝驅動 默認係『TCC計算模式』, 需改為『WDDM圖形模式』.

  1. 撳『Win+r』鍵,著『exe』
  2. 左側展開
Computer \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}
  1. 展開左側
  DriverDesc
0000 NVIDIA Tesla P40
0001 NVIDIA Quadro K6000
  1. 修改『0000』-『NVIDIA Tesla P40』
NAME TYPE VALUE
AdapterType REG_DWORD 1  – DELETE
FeatureScore REG_DWORD 0Xcf->0Xd1
GridLicensedFeatures REG_DWORD 7   (强制開啟GRID圖形模式)
EnableMsHybrid REG_DWORD 1
  1. 修改『0001』-『NVIDIA Quadro K6000
NAME TYPE VALUE
EnableMsHybrid REG_DWORD 2
  1. 重啟電腦
  2. 登入『命令行界面cmd』.
  3. 撳『ctrl+alt+del』鍵, 入『工作管理員』
  4. 撳『效能』,睇到『GPU0-NVIDIA Tesla P40』同埋『GPU0-NVIDIA Quadro K6000』. 『掂』
  5. 撳『nvidia-smi
  6. 『NVIDIA Tesla P40』改為『WDDM圖形模式』
  7. 進入『GPU-Z』
  8. 下面框框冚辦闌打勾勾

 

圖形設定指定-GPU: NVIDIA Tesla P40

  1. 撳『設定』
  2. 撳『系统』->『顯示器』->『圖形設定』
  3. 『硬體加速GPU排程』撳『開啟』
  4. 揀『傅统型應用程式』
  5. 撳『瀏覧』揀『.EXE』
  6. 撳『選項』
  7. 勾『GPU: NVIDIA Tesla P40』

 

NVIDIA GPU指定『Tesla P40』

  1. 入『NVIDIA控制面板』
  2. 撳『3D設定』->『管理3D設定』
  3. 『廣域設定』
  4. 『CUDA-GPU』揀『Tesla P40』
  5. 『OpenGL呈現GPU』揀『Tesla P40』

 

 

 

nvidia-smi

nvidia-smi
nvidia-smi

『nvidia-smi.exe』, 係nvidia公司開發蒞睇gpu. 基於命令行界面, 而非圖形界面. 可能考慮兼容同稳定.随nvidia顯卡驅動安裝自動复制,路徑如下.

C:\Windows\System32\nvidia-smi.exe
  1. 撳『win+r』, 填cmd, 登入『命令行界面』.
  2. 撳『nvidia-smi.exe』
講解
Nvidia-smi 程式版本號
Driver version 顯卡驅動版本號
CUDA Version CUDA至高支援版本號
GPU 顯卡編號, 0開如始編址,
FAN 風扇轉速(0~100%),冇風扇(N/A)
NAME 顯卡型號
Temp GPU温度,0C ~ 100C
Perf 性能, 至高p0級~至低p12級
Pwr: Usage/Cap 顯卡能耗,
『usage』
使用率,『Cap』能耗牆
Bus-ID 顯卡總線地埗
Disp.A 圖像顯示輸出,OFF閂, ON著
Memory-Usage 顯存使用率
GPU-Util GPU使用率
Compute M. 計算模式DEFAULT/EXCLUSIVE_PROCESS/PROHIBITED
ECC 顯存校驗糾錯

 

CUDA下載安装

CUDA下載安装
CUDA下載安装

CUDA係NVIDIA為GPU并行運算而開發,用C語言調用GPU-CUDA指令集進行大規模并行運行.

虽然上世紀以經有『INTEL-SEE』并行運算指令集,但係『NVIDIA-CUDA』青出於蓝.

『PyTorch』暫時至高支持『CUDA 12.1』.

登入『CUDA官網』, 下載『CUDA Toolkit 12.1.1

 

https://developer.nvidia.com/cuda-toolkit-archive/