vjai-community / ml-infra-tools

Tools for building ML environments & infra
MIT License
1 stars 1 forks source link

Error in notebooks/Test.ipynb #1

Open nptdat opened 3 years ago

nptdat commented 3 years ago

File: https://github.com/vjai-community/ml-infra-tools/blob/main/notebooks/Test.ipynb Error:

import torch
torch.cuda.current_device()

->

RuntimeErrorTraceback (most recent call last)
<ipython-input-1-873301375205> in <module>
      1 import torch
----> 2 torch.cuda.current_device()

/opt/conda/envs/vjai_paper_coding/lib/python3.7/site-packages/torch/cuda/__init__.py in current_device()
    364 def current_device() -> int:
    365     r"""Returns the index of a currently selected device."""
--> 366     _lazy_init()
    367     return torch._C._cuda_getDevice()
    368 

/opt/conda/envs/vjai_paper_coding/lib/python3.7/site-packages/torch/cuda/__init__.py in _lazy_init()
    170         # This function throws if there's a driver initialization error, no GPUs
    171         # are found or any other error occurs
--> 172         torch._C._cuda_init()
    173         # Some of the queued calls may reentrantly call _lazy_init();
    174         # we need to just return without initializing in that case.

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

It's not good to leave such basic errors in sample file.

anhlt commented 3 years ago

@nptdat

I think it's related to some config in docker runtime Can you try to update docker default runtime by create file deamon.json in /etc/docker with content below

$ cat /etc/docker/daemon.json
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
nptdat commented 3 years ago

Ah, I meant the current text of Test.ipynb on github still contains the error text. Just click on this link, then you can see it.

https://github.com/vjai-community/ml-infra-tools/blob/main/notebooks/Test.ipynb