Pytorch >= 2.0.0, python 3.10 and cuda 12 on google cloud vm

815 views Asked by At

Why is it so hard to get Pytorch >= 2.0.0, python 3.10 and cuda 12 on a google cloud vm ? All they have is debian with cuda 11.2 preinstalled. In debian the only way to install python3.10 is by downloading the tar and building it manually. There is no way of downloading it with the package manager. And Cuda 12 has to be manually installed too. If Google Cloud would have Arch as a distribution both of these things would be simpler than dealing with the tar of python3.10. How could this be done in an easy way ?

Googled, found nothing reasonable.

1

There are 1 answers

0
Satyajit On

I too spent some time frustrated with this. Do not use the preloaded debian image that comes with cuda 11.2 and pytorch 1.3. Instead start off with just a debian image and it's easier to install the cuda toolkit from scratch. See this page. Python 3 is already installed btw.

These are the steps I ran after sshing into a freshly provisioned VM

curl https://raw.githubusercontent.com/GoogleCloudPlatform/compute-gpu-installation/main/linux/install_gpu_driver.py --output install_gpu_driver.py
sudo python3 install_gpu_driver.py

and then install pip3 and pytorch 2.0

sudo apt-get install python3-pip
pip3 install torch torchvision torchaudio