{"id":493,"date":"2024-10-13T21:07:21","date_gmt":"2024-10-13T21:07:21","guid":{"rendered":"https:\/\/hivemind.science\/?p=493"},"modified":"2024-11-14T21:09:07","modified_gmt":"2024-11-14T21:09:07","slug":"setting-up-your-development-environment-for-hive-mind-ant-colony-simulation","status":"publish","type":"post","link":"https:\/\/hivemind.science\/?p=493","title":{"rendered":"Blog #2: Setting Up our Development Environment for &#8216;Hive Mind&#8217; Ant Colony Simulation"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\">While we move forward with the &#8216;Hive Mind&#8217; project, there\u2019s more to do than just installing Unreal Engine 5 (UE5). We need to set up the right tools for coding and debugging to make our workflow smoother and more efficient. Whether you\u2019re following along with this project or just curious about the tools we\u2019re using, here\u2019s a breakdown of the next steps.<\/p>\n\n\n\n<div style=\"height:37px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Choosing a Code Editor<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">For the coding side of this project, I\u2019m using tools from the JetBrains suite, which I\u2019ve found incredibly powerful and user-friendly. However, if you\u2019re looking for a free alternative, Visual Studio Code from Microsoft is another great choice. It\u2019s lightweight, fast, and has an extensive library of plugins for all kinds of development needs.<\/p>\n\n\n\n<div style=\"height:42px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>My Setup for C++ and Unreal Engine<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">When working with C++ in Unreal Engine, I\u2019ve installed Visual Studio Community 2022. This is a free, feature-rich version of Visual Studio that is perfect for C++ development with Unreal. But my preferred tool for coding in Unreal Engine is JetBrains Rider, which integrates seamlessly with Unreal Engine, making debugging and coding easier. The built-in features in Rider allow you to navigate Unreal Engine\u2019s large codebase effortlessly, and its debugger is incredibly useful when hunting down bugs in your code.  <\/p>\n\n\n\n<div style=\"height:43px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">To use Rider as your code editor in Unreal Engine, simply head to the Editor Preferences menu and search for &#8220;Source Code Editor.&#8221; There, you\u2019ll find an option to select the code editor of your choice\u2014just choose Rider, and you\u2019re all set. This small adjustment makes working with Unreal a lot smoother.<\/p>\n\n\n\n<div style=\"height:36px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Python Development in WSL2 with CUDA for TensorFlow<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">On the Python side of things, I\u2019ve opted for JetBrains PyCharm, which is perfect for handling our machine learning setup. The great thing about PyCharm is that you can open projects directly within WSL2 (Windows Subsystem for Linux 2), allowing you to run Linux commands seamlessly from within your editor. This makes updating or installing Python packages just as easy as if you were running everything natively on Windows.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">If you\u2019re planning to use CUDA for TensorFlow to leverage your NVIDIA GPU, you\u2019ll need to follow NVIDIA\u2019s setup instructions to get it working correctly within WSL2. Here\u2019s a quick summary of the steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><strong>Install the NVIDIA Driver:<\/strong> First, ensure that you have the latest NVIDIA driver installed on your Windows machine that supports WSL2. This driver is specifically designed for WSL and supports CUDA.<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>Install CUDA Toolkit<\/strong>: Once the driver is in place, install the CUDA Toolkit inside your WSL2 environment. NVIDIA provides a package repository for Ubuntu that allows you to install the necessary CUDA libraries.<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>Install cuDNN:<\/strong> TensorFlow also requires cuDNN (CUDA Deep Neural Network library). This can be installed alongside the CUDA Toolkit from NVIDIA&#8217;s repository.<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>Configure Environment Variables<\/strong>: After installing CUDA and cuDNN, you\u2019ll need to set up environment variables to ensure TensorFlow can locate these libraries. You can do this by adding the paths to your .bashrc file.<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>Install TensorFlow with GPU Support: <\/strong>Finally, install the version of TensorFlow that includes GPU support by running pip install tensorflow-gpu. This will ensure that TensorFlow can take advantage of CUDA for faster computation.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:42px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">By following these steps, you\u2019ll be able to run TensorFlow with GPU acceleration inside your WSL2 environment, taking full advantage of NVIDIA GPU\u2019s power.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-ti-fg-color has-text-color has-link-color has-medium-font-size wp-elements-40dea50c097b00f8ee2e417001048b0e wp-block-paragraph\">For more information use these links: <\/p>\n\n\n\n<p class=\"has-ti-accent-color has-text-color has-link-color wp-elements-c8d94a6b931c619e1325e2a92879de01 wp-block-paragraph\"><a href=\"https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html\">https:\/\/docs.nvidia.com\/cuda\/wsl-user-guide\/index.html<\/a><\/p>\n\n\n\n<p class=\"has-ti-accent-color has-text-color has-link-color wp-elements-33821afb4a2811272dcad1146c9465db wp-block-paragraph\"><a href=\"https:\/\/www.tensorflow.org\/install\/pip\">https:\/\/www.tensorflow.org\/install\/pip<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>While we move forward with the &#8216;Hive Mind&#8217; project, there\u2019s more to do than just installing Unreal Engine 5 (UE5). We need to set up the right tools for coding and debugging to make our workflow smoother and more efficient. Whether you\u2019re following along with this project or just curious about the tools we\u2019re using, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-493","post","type-post","status-publish","format-standard","hentry","category-tech_deep_dives"],"_links":{"self":[{"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/posts\/493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hivemind.science\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=493"}],"version-history":[{"count":12,"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions"}],"predecessor-version":[{"id":562,"href":"https:\/\/hivemind.science\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions\/562"}],"wp:attachment":[{"href":"https:\/\/hivemind.science\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hivemind.science\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hivemind.science\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}