nlp-with-transformers / notebooks

Jupyter notebooks for the Natural Language Processing with Transformers book
https://transformersbook.com/
Apache License 2.0
3.7k stars 1.13k forks source link

No GPU was detected - Amazon Sagemaker Studio Lab #140

Open devBorbot opened 2 weeks ago

devBorbot commented 2 weeks ago

Information

The problem arises in chapter:

Describe the bug

GPU is not being detected using Amazon Sagemaker Studio Lab

To Reproduce

When running the following code:

#hide
from utils import *
setup_chapter()

Output is:

No GPU was detected! This notebook can be *very* slow without a GPU 🐢
Using transformers v4.16.2
Using datasets v1.16.1

Additionally, I checked if the runtime has gpu in terminal with nvcc --version:

(book) studio-lab-user@default:~/notebooks$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

I would expect that when running torch.cuda.is_available() in notebook the result would be True

Please let me know if you need any more information from me. Also, thank you in advance.