0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

(Pop!_OS 22.04 LTS) CPUだけでPyTorchを動かすための軟軟ガイド

0
Last updated at Posted at 2025-12-03

最終更新日: 2025/12/04
対象: Pop!_OS 22.04 LTS (GPUなし/古いノートPC向け)


ガイド概要

  • GPU不使用、CPUのみでPyTorchの採算/推論のみを行う環境を構築するのが目的
  • 少ないメモリ、簡易な構成、ビルド時のエラーを回避

0. 前提

  • Pop!_OS 22.04 LTS がインストールされていること
  • NVIDIA GPU は不要

1. 必須パッケージのインストール

sudo apt update && sudo apt upgrade -y

sudo apt install -y \
  build-essential \
  wget curl \
  unzip zip \
  git tmux htop \
  language-pack-ja

2. Python環境の準備 (venv 推奨)

sudo apt install -y python3-venv

python3 -m venv ~/venvs/pytorch_cpu_only
source ~/venvs/pytorch_cpu_only/bin/activate

pip install --upgrade pip setuptools wheel

3. PyTorch (CPU ビルド) のインストール

pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1

ポイント:

  • pip 経由の PyTorch は MKL/ライブラリの互換性問題が起きにくく、復帰性が高いので安心
  • CUDA なしの CPU-only ビルドのため GPU/ドライバは不要

4. PyTorch 動作確認

python - << 'EOF'
import torch
print("torch:", torch.__version__)
print("cuda available:", torch.cuda.is_available())
print("device count:", torch.device("cpu"))
EOF

5. 結論

  • CPU のみで PyTorch 1.13.1 の推論を動作させたい場合、conda を使わず venv + pip で構築するのが最もシンプル。
  • ドライバや CUDA などの設定はすべて無視でOK
  • シンプル、軟軟、ライトな構成で、古いPCでもあんしんなの♡
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?