# M40 安装cuda和torch

1. 设置BIOS
    1. 打开 PCIE 4G 支持
    2. 使用V100需要在BIOS内打开above 4g decoding和resize bar，关闭csm
2. 驱动

    1. sudo add-apt-repository ppa:graphics-drivers/ppa
    2. sudo apt update
    3. sudo apt install nvidia-driver-550
3. CUDA 11.8
    1. [https://developer.nvidia.com/cuda-11-8-0-download-archive?target\_os=Linux&target\_arch=x86\_64&Distribution=Ubuntu&target\_version=22.04&target\_type=runfile\_local](https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local)
    2. sudo sh cuda\*
4. Pytorch
    1. [https://pytorch.org/get-started/previous-versions/](https://pytorch.org/get-started/previous-versions/)
    2. pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu118