--- title: 'cuda 12 環境下 onnxruntime-gpu 安装' disqus: hackmd --- cuda 12 環境下 onnxruntime-gpu 安装 === 安裝方法 --- >cuda 12 下 onnxruntime-gpu 不能直接用 pip 安裝,否則只會吃到 cpu 資源,請使用以下方法安裝: ```gherkin= # 如果環境已安裝 onnxruntime-gpu 請先解除安裝 pip uninstall onnxruntime-gpu pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ ``` > 使用以下指令確認 onnx 是否包含 CUDAExecutionProvider,如果有 onnx 才會使用 gpu 資源 ```gherkin= import onnxruntime as ort print("Available providers:", ort.get_available_providers()) ``` 參考來源 --- > https://github.com/Tencent/MimicMotion/issues/44
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.