{
  "id": 343732,
  "title": "Free the GPU Memory",
  "url": "/competitions/amex-default-prediction/discussion/343732",
  "author_name": "Mohamed Eltayeb",
  "post_date": "2022-08-12T10:10:20.905000",
  "votes": 14,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hello,<br>\nAs that the dataset is so big, you will need to free the GPU memory frequently (especially if you are using cudf and cupy).<br>\nYou can use this code to do that:</p>\n<p><code>#Free The GPU Memory</code><br>\n<code>from numba import cuda</code><br>\n<code>cuda.select_device(0)</code><br>\n<code>cuda.close()</code><br>\n<code>cuda.select_device(0)</code></p>",
  "messages": [
    {
      "id": 1895682,
      "postDate": "2022-08-12T10:10:20.907Z",
      "content": "<p>Hello,<br>\nAs that the dataset is so big, you will need to free the GPU memory frequently (especially if you are using cudf and cupy).<br>\nYou can use this code to do that:</p>\n<p><code>#Free The GPU Memory</code><br>\n<code>from numba import cuda</code><br>\n<code>cuda.select_device(0)</code><br>\n<code>cuda.close()</code><br>\n<code>cuda.select_device(0)</code></p>",
      "rawMarkdown": "Hello,\nAs that the dataset is so big, you will need to free the GPU memory frequently (especially if you are using cudf and cupy).\nYou can use this code to do that:\n\n`#Free The GPU Memory`\n`from numba import cuda`\n`cuda.select_device(0)`\n`cuda.close()`\n`cuda.select_device(0)`",
      "votes": 14
    },
    {
      "id": 1906784,
      "postDate": "2022-08-20T07:37:39.907Z",
      "content": "<p>That's a great trick. Thanks for sharing!</p>",
      "rawMarkdown": "That's a great trick. Thanks for sharing!",
      "votes": 1,
      "replies": [
        {
          "id": 1906796,
          "postDate": "2022-08-20T07:47:44.853Z",
          "content": "<p>Glad it was helpful!</p>",
          "rawMarkdown": "Glad it was helpful!",
          "votes": 1
        }
      ]
    },
    {
      "id": 1906439,
      "postDate": "2022-08-19T22:12:05.223Z",
      "content": "<p>It is so funny that you need to import numba inorder to free the gpu memory allcated by other packages that are not numba</p>",
      "rawMarkdown": "It is so funny that you need to import numba inorder to free the gpu memory allcated by other packages that are not numba\n\n\n",
      "votes": 1,
      "replies": [
        {
          "id": 1906669,
          "postDate": "2022-08-20T05:38:26.787Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 1906784,
      "author_name": "Chris Deotte",
      "author_url": "",
      "post_date": "2022-08-20T07:37:39.907000",
      "content": "<p>That's a great trick. Thanks for sharing!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1906796,
          "author_name": "Mohamed Eltayeb",
          "author_url": "",
          "post_date": "2022-08-20T07:47:44.853000",
          "content": "<p>Glad it was helpful!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1906439,
      "author_name": "The Devastator",
      "author_url": "",
      "post_date": "2022-08-19T22:12:05.223000",
      "content": "<p>It is so funny that you need to import numba inorder to free the gpu memory allcated by other packages that are not numba</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1906669,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-08-20T05:38:26.787000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1895682": "Hello,\nAs that the dataset is so big, you will need to free the GPU memory frequently (especially if you are using cudf and cupy).\nYou can use this code to do that:\n\n`#Free The GPU Memory`\n`from numba import cuda`\n`cuda.select_device(0)`\n`cuda.close()`\n`cuda.select_device(0)`",
    "1906784": "That's a great trick. Thanks for sharing!",
    "1906439": "It is so funny that you need to import numba inorder to free the gpu memory allcated by other packages that are not numba\n\n\n"
  }
}