import torch
= torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device if torch.cuda.is_available():
print(torch.cuda.current_device())
print(torch.cuda.device_count())
print(torch.cuda.get_device_name(0))
device
Development Environment Setup
Ubuntu and MAC users
Install docker in your system and the VSCode docker and remote extensions.
Windows users
Install WSL2.
Ensure that you also follow this tutorial to setup VSCode properly aka the VSCode can access the WSL2 filesystem and work with the remote docker containers.
If you have an NVIDIA GPU in your system, ensure you have enabled it.
All Users
Following the instructions of the course site with respect to the course docker container
- Install docker on your machine.
- Clone the repo (For windows users ensure that you clone it on the WSL2 filesystem.) Show this by a screenshot below of the terminal where you have cloned the repo.
- Build and launch the docker container inside your desired IDE (if you havent used an IDE before you can start with VSCode).
- Launch the virtual environment with
rye sync
inside the container and then show a screenshot of your IDE and the terminal with the(your virtual env)
prefix. - Select the kernel of your virtual environment (.venv folder) and execute the following code. Save the output of all cells of this notebook before submitting.
In [2]: