# Create a conda environment for PyTorch with GPU support

*An Efficient Step-by-Step Guide to Setting Up PyTorch with GPU Support*

By [Perception](https://paragraph.com/@perception) · 2024-12-17

---

Step 1: Install Nvidia-driver. Check Nvidia drivers from the link provided as follows:

[https://www.nvidia.com/en-us/drivers/](https://www.nvidia.com/en-us/drivers/)

    sudo apt install nvidia-driver-566

Step 2: Create a conda environment and name it. For example, a torch environment with the name "torch" can be created as:

    conda create --name torch python=3.11

Step 3: Activate the newly created conda environment.

Step 4: Install cudatoolkit and pytorch. Check compatible versions in the link below:

[https://pytorch.org/get-started/locally/](https://pytorch.org/get-started/locally/)

    conda install pytorch torchvision torchaudio cudatoolkit=11.7 -c pytorch -c nvidia

By following these steps, you'll set up a conda environment for PyTorch with the necessary GPU support in no time, enabling efficient deep learning workflows.

#### Result

![](https://storage.googleapis.com/papyrus_images/6f06ccedb1c995beac86ab29c173fef4.png)

---

*Originally published on [Perception](https://paragraph.com/@perception/create-a-conda-environment-for-pytorch-with-gpu-support)*
