{
  "id": 177125,
  "title": "CUDA is not available?!",
  "url": "/competitions/lyft-motion-prediction-autonomous-vehicles/discussion/177125",
  "author_name": "Peter",
  "post_date": "2020-08-24T23:50:23.134000",
  "votes": 17,
  "comment_count": 15,
  "views": 0,
  "content": "<p>CUDA is not available (PyTorch) if I add the <code>kaggle_l5kit</code> utility script to my notebook. (GPU is enabled; Quota is counting)</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F8aaf3f0e1ea5d8b81b9aa6bffdae63da%2Fcuda_not_available.png?generation=1598312842124457&amp;alt=media\" alt=\"\"></p>\n<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>",
  "messages": [
    {
      "id": 984201,
      "postDate": "2020-08-24T23:50:23.133Z",
      "content": "<p>CUDA is not available (PyTorch) if I add the <code>kaggle_l5kit</code> utility script to my notebook. (GPU is enabled; Quota is counting)</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F8aaf3f0e1ea5d8b81b9aa6bffdae63da%2Fcuda_not_available.png?generation=1598312842124457&amp;alt=media\" alt=\"\"></p>\n<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>",
      "rawMarkdown": "CUDA is not available (PyTorch) if I add the `kaggle_l5kit` utility script to my notebook. (GPU is enabled; Quota is counting)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F8aaf3f0e1ea5d8b81b9aa6bffdae63da%2Fcuda_not_available.png?generation=1598312842124457&alt=media)\n\n@philculliton ",
      "votes": 16
    },
    {
      "id": 984203,
      "postDate": "2020-08-24T23:58:18.037Z",
      "content": "<p>Thanks Peter! I'll take a look.</p>",
      "rawMarkdown": "Thanks Peter! I'll take a look.",
      "votes": 1,
      "replies": [
        {
          "id": 984209,
          "postDate": "2020-08-25T00:14:15.977Z",
          "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>\n<p>It seems there is another bug. I committed a notebook (<code>kaggle_l5kit</code> included), and the saved output (I tried with quick and full save too) freezes my browser (latest Chrome).</p>\n<p>I am not sure that <code>kaggle_l5kit</code> causes this, but it seems so.</p>",
          "rawMarkdown": "@philculliton \n\nIt seems there is another bug. I committed a notebook (`kaggle_l5kit` included), and the saved output (I tried with quick and full save too) freezes my browser (latest Chrome).\n\nI am not sure that `kaggle_l5kit` causes this, but it seems so.\n",
          "votes": 3
        },
        {
          "id": 984963,
          "postDate": "2020-08-25T11:54:18.623Z",
          "content": "<p>When you get a torch.cuda is not available problem, check torch.<strong>version</strong>.  It is likely that torch is upgraded and no longer 1.5. I had a similar problem when pytorch got upgraded because of another package to pytorch 1.6. Installing the right cuda:<br>\n!pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f <br>\n <a href=\"https://download.pytorch.org/whl/torch_stable.html\" target=\"_blank\">https://download.pytorch.org/whl/torch_stable.html</a> <br>\nworked for me.</p>",
          "rawMarkdown": "When you get a torch.cuda is not available problem, check torch.__version__.  It is likely that torch is upgraded and no longer 1.5. I had a similar problem when pytorch got upgraded because of another package to pytorch 1.6. Installing the right cuda:\n!pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f \n https://download.pytorch.org/whl/torch_stable.html \nworked for me.",
          "isDeleted": true
        },
        {
          "id": 984977,
          "postDate": "2020-08-25T12:08:46.513Z",
          "content": "<p>I have the same problem with the freezing browser.<br>\nWhen I want to commmit my output file then Input and Output directory are not loaded in the Viewer. <br>\nBut this is only the case when I use the offline version of l5kit for trying to commit.<br>\nWhen I enable internet and use pip install l5kit this is no problem. <br>\nSo I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data. <br>\nAny workaround for that?</p>",
          "rawMarkdown": "I have the same problem with the freezing browser.\nWhen I want to commmit my output file then Input and Output directory are not loaded in the Viewer. \nBut this is only the case when I use the offline version of l5kit for trying to commit.\nWhen I enable internet and use pip install l5kit this is no problem. \nSo I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data. \nAny workaround for that?"
        },
        {
          "id": 985057,
          "postDate": "2020-08-25T13:27:01.240Z",
          "content": "<blockquote>\n  <p>So I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data.</p>\n</blockquote>\n<p>I agree.</p>",
          "rawMarkdown": "> So I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data.\n\nI agree."
        },
        {
          "id": 985316,
          "postDate": "2020-08-25T16:35:55.880Z",
          "content": "<p>Hi all. Thanks. Yep, as mentioned elsewhere - there's currently a bug with displaying the utility script. It tries to load ALL of the files in the script into the file explorer - which freezes the page until the process is complete. I'm working on finding a workaround until it gets fixed on the back end.</p>",
          "rawMarkdown": "Hi all. Thanks. Yep, as mentioned elsewhere - there's currently a bug with displaying the utility script. It tries to load ALL of the files in the script into the file explorer - which freezes the page until the process is complete. I'm working on finding a workaround until it gets fixed on the back end.",
          "votes": 2
        },
        {
          "id": 985327,
          "postDate": "2020-08-25T16:41:33.833Z",
          "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>\n<p>This solution fixed both the freezing and the cuda issue:</p>\n<pre><code>import os\n\n## this script transports l5kit and dependencies\n# os.system('pip uninstall typing -y')\nos.system('pip install --target=/kaggle/working pymap3d==2.1.0')\nos.system('pip install --target=/kaggle/working protobuf==3.12.2')\nos.system('pip install --target=/kaggle/working transforms3d')\nos.system('pip install --target=/kaggle/working zarr')\nos.system('pip install --target=/kaggle/working ptable')\n\nos.system('pip install --no-dependencies --target=/kaggle/working l5kit')\n</code></pre>\n<p>Train and inference is working, I haven't tried any other features from l5kit.</p>",
          "rawMarkdown": "@philculliton \n\nThis solution fixed both the freezing and the cuda issue:\n\n```\nimport os\n\n## this script transports l5kit and dependencies\n# os.system('pip uninstall typing -y')\nos.system('pip install --target=/kaggle/working pymap3d==2.1.0')\nos.system('pip install --target=/kaggle/working protobuf==3.12.2')\nos.system('pip install --target=/kaggle/working transforms3d')\nos.system('pip install --target=/kaggle/working zarr')\nos.system('pip install --target=/kaggle/working ptable')\n\nos.system('pip install --no-dependencies --target=/kaggle/working l5kit')\n```\n\nTrain and inference is working, I haven't tried any other features from l5kit.",
          "votes": 6
        },
        {
          "id": 985332,
          "postDate": "2020-08-25T16:48:23.847Z",
          "content": "<p>Awesome! I'll test it out on my end. Thanks!</p>",
          "rawMarkdown": "Awesome! I'll test it out on my end. Thanks!",
          "votes": 1
        },
        {
          "id": 985334,
          "postDate": "2020-08-25T16:50:34.223Z",
          "content": "<p>Oh, oops - yeah, appears there might be other bits and pieces we need in there for full functionality. This helps, though - I'll use this as a starting point. Thank you!</p>",
          "rawMarkdown": "Oh, oops - yeah, appears there might be other bits and pieces we need in there for full functionality. This helps, though - I'll use this as a starting point. Thank you!",
          "votes": 5
        }
      ]
    },
    {
      "id": 1038091,
      "postDate": "2020-10-05T14:39:28.510Z",
      "content": "<p>I think the ultimate solution is for kaggle to upgrade its gpu docker image to use Cuda 10.2 instead of 10.1, the latter of which has a dedicated install instruction of <code>pytorch</code> per its official website, i.e. if you just <code>pip install torch</code> it'll install the one with Cuda 10.2 and render the GPU unused.</p>",
      "rawMarkdown": "I think the ultimate solution is for kaggle to upgrade its gpu docker image to use Cuda 10.2 instead of 10.1, the latter of which has a dedicated install instruction of `pytorch` per its official website, i.e. if you just `pip install torch` it'll install the one with Cuda 10.2 and render the GPU unused."
    },
    {
      "id": 1033268,
      "postDate": "2020-09-30T19:28:21.100Z",
      "content": "<pre><code>!pip uninstall -y typing\n!pip install l5kit\n</code></pre>\n<p>this is my solution. Using the pypy package instead of the util on kaggle. </p>",
      "rawMarkdown": "```python\n!pip uninstall -y typing\n!pip install l5kit\n```\n\nthis is my solution. Using the pypy package instead of the util on kaggle. ",
      "replies": [
        {
          "id": 1037429,
          "postDate": "2020-10-05T02:47:24.820Z",
          "content": "<blockquote>\n<pre><code>!pip uninstall -y typing\n!pip install l5kit\n</code></pre>\n  <p>this is my solution. Using the pypy package instead of the util on kaggle.</p>\n</blockquote>\n<p>I also used this approach. And I've created <a href=\"https://www.kaggle.com/etareduce/kaggle-l5kit-110\" target=\"_blank\">https://www.kaggle.com/etareduce/kaggle-l5kit-110</a> in case anyone wants to try out.</p>",
          "rawMarkdown": "> ```python\n> !pip uninstall -y typing\n> !pip install l5kit\n> ```\n> \n> this is my solution. Using the pypy package instead of the util on kaggle.\n\nI also used this approach. And I've created https://www.kaggle.com/etareduce/kaggle-l5kit-110 in case anyone wants to try out."
        }
      ]
    },
    {
      "id": 986724,
      "postDate": "2020-08-26T18:19:48.400Z",
      "content": "<p>If you force the device to be cuda like this:</p>\n\n<p><code>device = torch.device(\"cuda:0\")\nprint(device)</code></p>\n\n<p>It prints out \"cuda\" but then when you try and use the device in your code later you see this error:</p>\n\n<blockquote>\n  <p>AssertionError: \n  The NVIDIA driver on your system is too old (found version 10010).\n  Please update your GPU driver by downloading and installing a new\n  version from the URL: <a href=\"http://www.nvidia.com/Download/index.aspx\">http://www.nvidia.com/Download/index.aspx</a>\n  Alternatively, go to: <a href=\"https://pytorch.org\">https://pytorch.org</a> to install\n  a PyTorch version that has been compiled with your version\n  of the CUDA driver.</p>\n</blockquote>",
      "rawMarkdown": "If you force the device to be cuda like this:\n\n`device = torch.device(\"cuda:0\")\nprint(device)`\n\nIt prints out \"cuda\" but then when you try and use the device in your code later you see this error:\n\n&gt; AssertionError: \n&gt;The NVIDIA driver on your system is too old (found version 10010).\n&gt;Please update your GPU driver by downloading and installing a new\n&gt;version from the URL: http://www.nvidia.com/Download/index.aspx\n&gt;Alternatively, go to: https://pytorch.org to install\n&gt;a PyTorch version that has been compiled with your version\n&gt;of the CUDA driver."
    },
    {
      "id": 986714,
      "postDate": "2020-08-26T18:09:46.833Z",
      "content": "<p>I found exactly the same thing.</p>",
      "rawMarkdown": "I found exactly the same thing."
    },
    {
      "id": 986728,
      "postDate": "2020-08-26T18:20:41.463Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 984203,
      "author_name": "Phil Culliton",
      "author_url": "",
      "post_date": "2020-08-24T23:58:18.037000",
      "content": "<p>Thanks Peter! I'll take a look.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 984209,
          "author_name": "Peter",
          "author_url": "",
          "post_date": "2020-08-25T00:14:15.977000",
          "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>\n<p>It seems there is another bug. I committed a notebook (<code>kaggle_l5kit</code> included), and the saved output (I tried with quick and full save too) freezes my browser (latest Chrome).</p>\n<p>I am not sure that <code>kaggle_l5kit</code> causes this, but it seems so.</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 984963,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-08-25T11:54:18.623000",
          "content": "<p>When you get a torch.cuda is not available problem, check torch.<strong>version</strong>.  It is likely that torch is upgraded and no longer 1.5. I had a similar problem when pytorch got upgraded because of another package to pytorch 1.6. Installing the right cuda:<br>\n!pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f <br>\n <a href=\"https://download.pytorch.org/whl/torch_stable.html\" target=\"_blank\">https://download.pytorch.org/whl/torch_stable.html</a> <br>\nworked for me.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 984977,
          "author_name": "Jan Bre",
          "author_url": "",
          "post_date": "2020-08-25T12:08:46.513000",
          "content": "<p>I have the same problem with the freezing browser.<br>\nWhen I want to commmit my output file then Input and Output directory are not loaded in the Viewer. <br>\nBut this is only the case when I use the offline version of l5kit for trying to commit.<br>\nWhen I enable internet and use pip install l5kit this is no problem. <br>\nSo I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data. <br>\nAny workaround for that?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 985057,
          "author_name": "Peter",
          "author_url": "",
          "post_date": "2020-08-25T13:27:01.240000",
          "content": "<blockquote>\n  <p>So I suppose this is due to the countless subpackages that need to be viualized in the Input directory in your Browser from the l5kit when you use it as external data.</p>\n</blockquote>\n<p>I agree.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 985316,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2020-08-25T16:35:55.880000",
          "content": "<p>Hi all. Thanks. Yep, as mentioned elsewhere - there's currently a bug with displaying the utility script. It tries to load ALL of the files in the script into the file explorer - which freezes the page until the process is complete. I'm working on finding a workaround until it gets fixed on the back end.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 985327,
          "author_name": "Peter",
          "author_url": "",
          "post_date": "2020-08-25T16:41:33.833000",
          "content": "<p><a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> </p>\n<p>This solution fixed both the freezing and the cuda issue:</p>\n<pre><code>import os\n\n## this script transports l5kit and dependencies\n# os.system('pip uninstall typing -y')\nos.system('pip install --target=/kaggle/working pymap3d==2.1.0')\nos.system('pip install --target=/kaggle/working protobuf==3.12.2')\nos.system('pip install --target=/kaggle/working transforms3d')\nos.system('pip install --target=/kaggle/working zarr')\nos.system('pip install --target=/kaggle/working ptable')\n\nos.system('pip install --no-dependencies --target=/kaggle/working l5kit')\n</code></pre>\n<p>Train and inference is working, I haven't tried any other features from l5kit.</p>",
          "votes": 6,
          "replies": []
        },
        {
          "id": 985332,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2020-08-25T16:48:23.847000",
          "content": "<p>Awesome! I'll test it out on my end. Thanks!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 985334,
          "author_name": "Phil Culliton",
          "author_url": "",
          "post_date": "2020-08-25T16:50:34.223000",
          "content": "<p>Oh, oops - yeah, appears there might be other bits and pieces we need in there for full functionality. This helps, though - I'll use this as a starting point. Thank you!</p>",
          "votes": 5,
          "replies": []
        }
      ]
    },
    {
      "id": 1038091,
      "author_name": "Jiayu",
      "author_url": "",
      "post_date": "2020-10-05T14:39:28.510000",
      "content": "<p>I think the ultimate solution is for kaggle to upgrade its gpu docker image to use Cuda 10.2 instead of 10.1, the latter of which has a dedicated install instruction of <code>pytorch</code> per its official website, i.e. if you just <code>pip install torch</code> it'll install the one with Cuda 10.2 and render the GPU unused.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1033268,
      "author_name": "Pascal Pfeiffer",
      "author_url": "",
      "post_date": "2020-09-30T19:28:21.100000",
      "content": "<pre><code>!pip uninstall -y typing\n!pip install l5kit\n</code></pre>\n<p>this is my solution. Using the pypy package instead of the util on kaggle. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 1037429,
          "author_name": "Jiayu",
          "author_url": "",
          "post_date": "2020-10-05T02:47:24.820000",
          "content": "<blockquote>\n<pre><code>!pip uninstall -y typing\n!pip install l5kit\n</code></pre>\n  <p>this is my solution. Using the pypy package instead of the util on kaggle.</p>\n</blockquote>\n<p>I also used this approach. And I've created <a href=\"https://www.kaggle.com/etareduce/kaggle-l5kit-110\" target=\"_blank\">https://www.kaggle.com/etareduce/kaggle-l5kit-110</a> in case anyone wants to try out.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 986724,
      "author_name": "Ian Ormesher",
      "author_url": "",
      "post_date": "2020-08-26T18:19:48.400000",
      "content": "<p>If you force the device to be cuda like this:</p>\n\n<p><code>device = torch.device(\"cuda:0\")\nprint(device)</code></p>\n\n<p>It prints out \"cuda\" but then when you try and use the device in your code later you see this error:</p>\n\n<blockquote>\n  <p>AssertionError: \n  The NVIDIA driver on your system is too old (found version 10010).\n  Please update your GPU driver by downloading and installing a new\n  version from the URL: <a href=\"http://www.nvidia.com/Download/index.aspx\">http://www.nvidia.com/Download/index.aspx</a>\n  Alternatively, go to: <a href=\"https://pytorch.org\">https://pytorch.org</a> to install\n  a PyTorch version that has been compiled with your version\n  of the CUDA driver.</p>\n</blockquote>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 986714,
      "author_name": "Ian Ormesher",
      "author_url": "",
      "post_date": "2020-08-26T18:09:46.833000",
      "content": "<p>I found exactly the same thing.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 986728,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-08-26T18:20:41.463000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "984201": "CUDA is not available (PyTorch) if I add the `kaggle_l5kit` utility script to my notebook. (GPU is enabled; Quota is counting)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F864684%2F8aaf3f0e1ea5d8b81b9aa6bffdae63da%2Fcuda_not_available.png?generation=1598312842124457&alt=media)\n\n@philculliton ",
    "984203": "Thanks Peter! I'll take a look.",
    "1038091": "I think the ultimate solution is for kaggle to upgrade its gpu docker image to use Cuda 10.2 instead of 10.1, the latter of which has a dedicated install instruction of `pytorch` per its official website, i.e. if you just `pip install torch` it'll install the one with Cuda 10.2 and render the GPU unused.",
    "1033268": "```python\n!pip uninstall -y typing\n!pip install l5kit\n```\n\nthis is my solution. Using the pypy package instead of the util on kaggle. ",
    "986724": "If you force the device to be cuda like this:\n\n`device = torch.device(\"cuda:0\")\nprint(device)`\n\nIt prints out \"cuda\" but then when you try and use the device in your code later you see this error:\n\n&gt; AssertionError: \n&gt;The NVIDIA driver on your system is too old (found version 10010).\n&gt;Please update your GPU driver by downloading and installing a new\n&gt;version from the URL: http://www.nvidia.com/Download/index.aspx\n&gt;Alternatively, go to: https://pytorch.org to install\n&gt;a PyTorch version that has been compiled with your version\n&gt;of the CUDA driver.",
    "986714": "I found exactly the same thing.",
    "986728": ""
  }
}