--- title: Running Snowflake in Visual Studio Code --- # Snowflake in Visual Studio Code One of the downsides of solving the Jupyter Notebook with Snowflake in the browser is the lack of code auto-complete supported by common IDEs like VScode, PyCharm, etc. Also, you will also have to download the solved notebook before submitting it. By solving the notebook localy you can overcome these issues, however you won't have the GPU Hardware for the more computationally demanding tasks in some notebooks. To solve this problem, you can connect to the Snowflake cluster and select the kernel in VScode, which will allow you to work locally while having access to Snowsflake's hardware. To achieve this, perform the following steps: ## 1. Connect to Snowflake Cluster Follow the steps explained at this [link](https://hackmd.io/@FzDZ9kehQuSArsJfzbjFbw/Skt3WP26a). Once done, you should see this in the terminal. ![Screenshot 2025-02-28 at 1.24.42 PM](https://hackmd.io/_uploads/rJs094yoyx.png) Remember, that the marked URL is what you post in the browser to access your Snowflake Cluster and it will be important to connect the cluster to VScode. ## 2. Download the Notebook First, go to HODL FS25 [webpage](https://disco.ethz.ch/courses/hodl/), and download the notebook. Click on the shown link the course webpage. ![Screenshot 2025-02-28 at 2.33.58 PM](https://hackmd.io/_uploads/Bya6sVksyx.png) Now click at the blue download button. ![Screenshot 2025-02-28 at 2.34.03 PM](https://hackmd.io/_uploads/ryiAj4yoyl.png) ## 3. Open Notebook in VSCode Use VSCode to open the recently downloaded Notebook. ![Screenshot 2025-02-28 at 1.34.37 PM](https://hackmd.io/_uploads/rydU241o1l.png) ![Screenshot 2025-02-28 at 1.34.48 PM](https://hackmd.io/_uploads/HJ-v24ko1l.png) Now, we proceed with kernel selection. ## 4. Select Kernel You now need to select the Kernel that will run the code written in the Jupyter Notebook code blocks. You can do this by either using the `Select Kernel` button on the top right. ![Screenshot 2025-02-28 at 1.34.57 PM](https://hackmd.io/_uploads/rkHeaEkjkg.png) or by typing the command `>Notebook: Select Notebook Kernel ` ![Screenshot 2025-02-28 at 1.35.25 PM](https://hackmd.io/_uploads/HyQPzrks1e.png) Now you select `Existing Jupyter Server...` ![Screenshot 2025-02-28 at 1.35.07 PM](https://hackmd.io/_uploads/SJIoMr1iJg.png) It will ask for you to up the URL of the Jupyter Kernel, which is the URL marked in step 1. Copy and Paste it here. ![Screenshot 2025-02-28 at 1.36.02 PM](https://hackmd.io/_uploads/S17kQSks1l.png) Wait for it to recognize the name ofthe cluster, then confirm. ![Screenshot 2025-02-28 at 1.36.08 PM](https://hackmd.io/_uploads/SyIbmHkike.png) Select the proposed Python Environment. ![Screenshot 2025-02-28 at 1.36.36 PM](https://hackmd.io/_uploads/B1eSQQryikg.png) The top right corner of the screen should now the selected kernel. ![Screenshot 2025-02-28 at 3.08.08 PM](https://hackmd.io/_uploads/ryMY7BJsye.png) ## 4. Sanity Check To be sure that you are able to access the cluster hardware, run the following cell ```python import torch device = "cuda" if torch.cuda.is_available() else "cpu" print(device) ``` This should print `'cuda'`, since this means you are accessing to Nvidia CUDA enabled GPU's from the cluster. ## 5. Conclusion Thats all and have fun solving the notebooks.