-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Sep 24, 2024
1 parent
1ed375e
commit 69808e5
Showing
5 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-24T01:30:20","documenter_version":"1.7.0"}} | ||
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-24T07:00:04","documenter_version":"1.7.0"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Tutorial 1 · TrixiCUDA.jl</title><meta name="title" content="Tutorial 1 · TrixiCUDA.jl"/><meta property="og:title" content="Tutorial 1 · TrixiCUDA.jl"/><meta property="twitter:title" content="Tutorial 1 · TrixiCUDA.jl"/><meta name="description" content="Documentation for TrixiCUDA.jl."/><meta property="og:description" content="Documentation for TrixiCUDA.jl."/><meta property="twitter:description" content="Documentation for TrixiCUDA.jl."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">TrixiCUDA.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>Tutorial 1</a><ul class="internal"><li><a class="tocitem" href="#Prerequisite"><span>Prerequisite</span></a></li><li><a class="tocitem" href="#Connect-to-Instance(s)"><span>Connect to Instance(s)</span></a></li><li><a class="tocitem" href="#Configure-Julia-Package"><span>Configure Julia Package</span></a></li><li><a class="tocitem" href="#Configure-CUDA-Toolkit"><span>Configure CUDA Toolkit</span></a></li><li><a class="tocitem" href="#Add-CUDA-Toolkit-to-Julia"><span>Add CUDA Toolkit to Julia</span></a></li><li><a class="tocitem" href="#Enable-SSH-with-Git-Repository-(Optional)"><span>Enable SSH with Git Repository (Optional)</span></a></li><li><a class="tocitem" href="#In-The-End"><span>In The End</span></a></li></ul></li><li><a class="tocitem" href="../nsys_profiling/">Tutorial 2</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Tutorial 1</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Tutorial 1</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/trixi-gpu/TrixiCUDA.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/trixi-gpu/TrixiCUDA.jl/blob/main/docs/src/aws_gpu_setup.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Tutorial-Setting-Up-Cloud-GPUs-for-Running-CUDA.jl"><a class="docs-heading-anchor" href="#Tutorial-Setting-Up-Cloud-GPUs-for-Running-CUDA.jl">Tutorial - Setting Up Cloud GPUs for Running CUDA.jl</a><a id="Tutorial-Setting-Up-Cloud-GPUs-for-Running-CUDA.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Tutorial-Setting-Up-Cloud-GPUs-for-Running-CUDA.jl" title="Permalink"></a></h1><p>Welcome to this tutorial! If you're looking to use GPUs in the cloud for running Julia programs with CUDA.jl, you're in the right place. This tutorial aims to help you set up cloud GPU on Amazon Web Service (AWS) to run CUDA.jl.</p><h2 id="Prerequisite"><a class="docs-heading-anchor" href="#Prerequisite">Prerequisite</a><a id="Prerequisite-1"></a><a class="docs-heading-anchor-permalink" href="#Prerequisite" title="Permalink"></a></h2><p>Before the tutorial begins, you should launch P type EC2 instance(s) on your own in AWS. Here are some links for you to quickly get to know key concepts and successfully launch your instance(s).</p><ul><li>What is Amazon EC2? https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html</li><li>Which type of EC2 should I use? https://aws.amazon.com/ec2/instance-types/</li><li>How to launch Amazon EC2? https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html</li><li>What is spot instance? (optional) https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html</li><li>How to work with spot instance? (optional) https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html</li></ul><p>The last two resources are optional if the cost isn't a concern for you, and you can choose to stick with on-demand instance(s). However, please note that in both cases you will need to manually request a quota for P type instances before launching.</p><h2 id="Connect-to-Instance(s)"><a class="docs-heading-anchor" href="#Connect-to-Instance(s)">Connect to Instance(s)</a><a id="Connect-to-Instance(s)-1"></a><a class="docs-heading-anchor-permalink" href="#Connect-to-Instance(s)" title="Permalink"></a></h2><p>Up to this step, we assume that you have already launched your EC2 instance(s). Now, you can connect to your instance(s) via your local terminal or any IDE with an SSH extension.</p><p>Move your key pair file (.pem) to the <code>.ssh</code> folder:</p><pre><code class="language-Bash hljs">$ mv ~/Downloads/<your-key-pair-name>.pem ~/.ssh/<your-key-pair-name>.pem</code></pre><p>Change the permission of the key pair file:</p><pre><code class="language-Bash hljs">$ chmod 600 ~/.ssh/<your-key-pair-name>.pem</code></pre><p>Copy the public IPv4 DNS of your instance(s) from AWS and then connect to your instance(s) via SSH:</p><pre><code class="language-Bash hljs">$ ssh -i ~/.ssh/<your-key-pair-name>.pem ubuntu@<your-ec2-public-ipv4-dns></code></pre><p>When prompted with the question <code>Are you sure you want to continue connecting (yes/no)?</code>, enter <code>yes</code>. At this point, you should be able to successfully connect to your instance(s).</p><h2 id="Configure-Julia-Package"><a class="docs-heading-anchor" href="#Configure-Julia-Package">Configure Julia Package</a><a id="Configure-Julia-Package-1"></a><a class="docs-heading-anchor-permalink" href="#Configure-Julia-Package" title="Permalink"></a></h2><p>In this step, we assume that you have already connected to your instance(s) and the commands are being executed in your instance(s)'s terminal.</p><p>You can find the version of the Julia package you want from https://julialang.org/downloads/. For illustration, we are using Julia version 1.10.0 for Linux on x86 64-bit.</p><p>Copy the address of the Julia package and download it to your instance(s):</p><pre><code class="language-Bash hljs">$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.0-linux-x86_64.tar.gz</code></pre><p>Extract your downloaded package:</p><pre><code class="language-Bash hljs">$ tar -xvf julia-1.10.0-linux-x86_64.tar.gz</code></pre><p>Create a symbolic link to the Julia:</p><pre><code class="language-Bash hljs">$ sudo ln -s ~/julia-1.10.0/bin/julia /usr/local/bin/julia</code></pre><p>Remove the original Julia package (optional):</p><pre><code class="language-Bash hljs">$ rm julia-1.10.0-linux-x86_64.tar.gz</code></pre><p>Then you should be able to run <code>julia</code> command successfully in your instance(s)'s root directory.</p><h2 id="Configure-CUDA-Toolkit"><a class="docs-heading-anchor" href="#Configure-CUDA-Toolkit">Configure CUDA Toolkit</a><a id="Configure-CUDA-Toolkit-1"></a><a class="docs-heading-anchor-permalink" href="#Configure-CUDA-Toolkit" title="Permalink"></a></h2><p>Like the former step, we assume that you have connected to your instance(s) and the commands are being executed in your instance(s)'s terminal.</p><p>Then you can easily download and configure the desired version of the CUDA Toolkit based on your selected platform through a set of commands available at https://developer.nvidia.com/cuda-downloads. After that, you may verify the version of the CUDA Toolkit you installed by running the <code>nvcc --version</code> command.</p><h2 id="Add-CUDA-Toolkit-to-Julia"><a class="docs-heading-anchor" href="#Add-CUDA-Toolkit-to-Julia">Add CUDA Toolkit to Julia</a><a id="Add-CUDA-Toolkit-to-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Add-CUDA-Toolkit-to-Julia" title="Permalink"></a></h2><p>In this step, we are going to add CUDA package to Julia. Again, this is based on the fact that you have already connected to your insrance(s).</p><p>Enter into Julia REPL:</p><pre><code class="language-Julia hljs">$ julia</code></pre><p>Enter Jualia package mode and add CUDA to Julia:</p><pre><code class="language-Julia hljs">pkg> add CUDA</code></pre><p>Then you can simply test CUDA in Julia by creating a <code>test.jl</code> file like below:</p><pre><code class="language-Julia hljs"># This is a test.jl file | ||
using CUDA | ||
CUDA.versioninfo()</code></pre><p>If the test result displays the version of CUDA without any errors, you have successfully added CUDA to Julia.</p><h2 id="Enable-SSH-with-Git-Repository-(Optional)"><a class="docs-heading-anchor" href="#Enable-SSH-with-Git-Repository-(Optional)">Enable SSH with Git Repository (Optional)</a><a id="Enable-SSH-with-Git-Repository-(Optional)-1"></a><a class="docs-heading-anchor-permalink" href="#Enable-SSH-with-Git-Repository-(Optional)" title="Permalink"></a></h2><p>This step is optional but recommended for those who are going to operate their git repository on EC2 instance(s).</p><p>Create an SSH key in your local terminal:</p><pre><code class="language-Bash hljs">$ ssh-keygen -t rsa -b 4096 -C <your-email-address></code></pre><p>Save the key to the default directory <code>~/.ssh</code> and enter a passphrase of your choice.</p><p>Change the permission of your SSH key:</p><pre><code class="language-Bash hljs">$ chmod 600 ~/.ssh/id_rsa</code></pre><p>Add your SSH private key to the ssh-agent:</p><pre><code class="language-Bash hljs">$ ssh-add -k ~/.ssh/id_rsa</code></pre><p>Copy the public key and use it to create a new SSH key in your GitHub.</p><p>Copy the public key into your EC2 instance(s):</p><pre><code class="language-Bash hljs">$ cat ~/.ssh/id_rsa.pub | ssh -i ~/.ssh/<your-key-pair-name>.pem ubuntu@<your-ec2-public-ipv4-dns> "cat >> .ssh/authorized_keys"</code></pre><p>Copy the private key to your EC2 instance(s):</p><pre><code class="language-Bash hljs">$ scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/<your-key-pair-name>.pem ~/.ssh/id_rsa ubuntu@<your-ec2-public-ipv4-dns>:~/.ssh/</code></pre><p>Then you can directly <code>git clone</code> and <code>git push</code> (or other operations) in your EC2 instance(s).</p><h2 id="In-The-End"><a class="docs-heading-anchor" href="#In-The-End">In The End</a><a id="In-The-End-1"></a><a class="docs-heading-anchor-permalink" href="#In-The-End" title="Permalink"></a></h2><p>After going through the previous steps, you can use CUDA.jl on your cloud GPU through AWS. Please remember to terminate your instance(s) when you no longer need them, as they will continue to incur charges.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../nsys_profiling/">Tutorial 2 »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 24 September 2024 01:30">Tuesday 24 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> | ||
CUDA.versioninfo()</code></pre><p>If the test result displays the version of CUDA without any errors, you have successfully added CUDA to Julia.</p><h2 id="Enable-SSH-with-Git-Repository-(Optional)"><a class="docs-heading-anchor" href="#Enable-SSH-with-Git-Repository-(Optional)">Enable SSH with Git Repository (Optional)</a><a id="Enable-SSH-with-Git-Repository-(Optional)-1"></a><a class="docs-heading-anchor-permalink" href="#Enable-SSH-with-Git-Repository-(Optional)" title="Permalink"></a></h2><p>This step is optional but recommended for those who are going to operate their git repository on EC2 instance(s).</p><p>Create an SSH key in your local terminal:</p><pre><code class="language-Bash hljs">$ ssh-keygen -t rsa -b 4096 -C <your-email-address></code></pre><p>Save the key to the default directory <code>~/.ssh</code> and enter a passphrase of your choice.</p><p>Change the permission of your SSH key:</p><pre><code class="language-Bash hljs">$ chmod 600 ~/.ssh/id_rsa</code></pre><p>Add your SSH private key to the ssh-agent:</p><pre><code class="language-Bash hljs">$ ssh-add -k ~/.ssh/id_rsa</code></pre><p>Copy the public key and use it to create a new SSH key in your GitHub.</p><p>Copy the public key into your EC2 instance(s):</p><pre><code class="language-Bash hljs">$ cat ~/.ssh/id_rsa.pub | ssh -i ~/.ssh/<your-key-pair-name>.pem ubuntu@<your-ec2-public-ipv4-dns> "cat >> .ssh/authorized_keys"</code></pre><p>Copy the private key to your EC2 instance(s):</p><pre><code class="language-Bash hljs">$ scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/<your-key-pair-name>.pem ~/.ssh/id_rsa ubuntu@<your-ec2-public-ipv4-dns>:~/.ssh/</code></pre><p>Then you can directly <code>git clone</code> and <code>git push</code> (or other operations) in your EC2 instance(s).</p><h2 id="In-The-End"><a class="docs-heading-anchor" href="#In-The-End">In The End</a><a id="In-The-End-1"></a><a class="docs-heading-anchor-permalink" href="#In-The-End" title="Permalink"></a></h2><p>After going through the previous steps, you can use CUDA.jl on your cloud GPU through AWS. Please remember to terminate your instance(s) when you no longer need them, as they will continue to incur charges.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../nsys_profiling/">Tutorial 2 »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 24 September 2024 07:00">Tuesday 24 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Oops, something went wrong.