-
Notifications
You must be signed in to change notification settings - Fork 1
/
Installing and Running MuMax3 by Onri Jay Benally.txt
88 lines (68 loc) · 6.63 KB
/
Installing and Running MuMax3 by Onri Jay Benally.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(This is the TXT version of the installation steps and example documentation of MuMax3).
___________________________________________________________________________
Quick references:
If installed already, start the GUI by going to step 5 below or type the following 2 lines into a non-admin command prompt or non-admin PowerShell:
cd <directory_to_your_file>
mumax3 -i <your_MuMax3_TXT_file_name.txt>
Note: MuMax3 scripts can be written as TXT file types. The above script will load & automatically run the script into a browser.
Example MuMax3 scripts can be copied from (https://mumax.github.io/examples.html) into a TXT file on your local machine, saved as a custom filename.
To run a script for obtaining a hysteresis loop, see Onri's Jupyter Notebook example in GitHub: https://github.com/OJB-Quantum/MuMax3-How-To/blob/main/Python%20Code_MuMax3%20Data%20Plots/Hysteresis_Loop_Example_2_by_MuMax_Locally_Run.ipynb
___________________________________________________________________________
To run mumax3.10 you need:
• An Nvidia GPU with at least a compute capability of 3.0 (https://developer.nvidia.com/cuda-gpus).
• An up-to-date Nvidia driver.
___________________________________________________________________________
If you need to install pip through Python, follow these steps:
• First, install an EXE file of Python from: https://www.python.org/downloads
• Then, install pip by entering the following command into local terminal (usually Command Prompt):
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
• Now, pip is ready for use!
___________________________________________________________________________
Some prerequisites for installing mumax3.10:
• Download & install Miniconda. JupyterLab or Jupyter Notebook can be installed optionally for post-processing data results (https://docs.anaconda.com/miniconda & https://jupyter.org/install). Google Colab in the browser is another alternative for post-processing the data (https://colab.research.google.com).
Run the following scripts in Anaconda Prompt [Admin] (comes with Miniconda installation):
• As an option, a custom MuMax3 environment can be created with the following script:
conda create --name <custom MuMax3 environment name>
• If a custom MuMax3 environment name has been created, activate the environment:
conda activate <custom MuMax3 environment name>
• Install PyTorch compatible with CUDA with the following script:
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia (to install PyTorch GPU & other versions check here: https://pytorch.org/get-started/locally).
• Then, run the following script if SciPy isn't installed:
conda install scipy
• Install CUDA from Nvidia: https://developer.nvidia.com/cuda-downloads
• Add CUDA to Path variables in system environment variables, unless the CUDA installation process added the variables automatically. Steps for editing Path variables are under Step 4 below.
• Restart computer.
___________________________________________________________________________
Installing MuMax3 itself:
1. Find out the Nvidia driver version:
Right-click on your desktop [in Windows] & open the Nvidia control panel. You should now see the driver version number. (The MuMax3 website will ask for which driver version you have before downloading).
2. Download mumax3.10:
Download the mumax3.10 executable for your driver from https://mumax.github.io/download.
3. Unzip the downloaded file:
Unzip the downloaded file in any directory you want. For the sake of the instructions here, we will assume you unzipped the file in C:\Users\JohnDoe\mumax3.10. The full path of the executable is now C:\Users\JohnDoe\mumax3.10\mumax3. Note that the directory also contains dll files. It is important that these Cuda library files stay in the same directory as the mumax3 executable.
4. Update the Path environment variable:
Add the directory to the Path environment variable by going to environment variables on your machine. Type "environment variables" on your Windows search bar >> once a System Properties window pops up, go to the Advanced tab >> click on Environment Variables button on the bottom right >> once the Environment Variables window pops up, go to the table on the bottom that says System Variables & click on Path >> press the Edit button on the bottom >> once the Edit Environment Variable window pops up, press the New button on the upper right >> paste the directory of your MuMax3 executable, then click OK on all the windows to close them. (Note that you have to add the directory of the executable, not the path of the executable itself).
5. Running a MuMax3 script:
First, open a new terminal or Powershell window >> navigate to the directory of the script: cd C:\Users\JohnDoe\Documents >> You can then run the script using the following command:
mumax3 <Filename_of_MuMax3_Script.txt>
In my case, open a fresh PowerShell window >> I use this:
cd C:\Users\ojbsn\OneDrive\Desktop___________\Downloads\Downloads\MuMax3
mumax3 -i <Filename_of_Custom_MuMax3_Script.txt>
Done! Once a simulation is finished running on the GPU, proceed to file location or directory of the results to copy the data into an Excel file, followed by naming the new Excel file for importing to data post-processing tool of choice (Colab, JupyterLab, Jupyter Notebook, etc.).
Online OVF file type visualization: https://mumax.ugent.be/mumax-view
While using the viewer, you can load multiple OVF files to play an animation of the magnetization frame capture.
__________________________________________________________________________
Optional: install gnuplot:
Download & install gnuplot. During the installation, make sure that you check the option to add the executable to the Path environment variable. If you forgot to check this option, you can do this manually in the same way as described in step 4. (pip install py-gnuplot)
(http://www.gnuplot.info/index.html) (https://youtu.be/Xx0NjUd1LQQ?si=1Hkg8WPVpVOk9vDz)
__________________________________________________________________________
Additional resources:
Official MuMax3 tutorial is located here: https://mumax.ugent.be/mumax3-workshop/#:~:text=Drs.%20Pieter%20Gypens-,Workshop%20material,-Here%20you%20can
MuMax3 overview paper:
https://ar5iv.labs.arxiv.org/html/1102.3069
Simulating modern magnetic materials paper (includes section on spin-orbit torque materials): https://pubs.aip.org/aip/jap/article/134/17/171101/2919250/Tutorial-Simulating-modern-magnetic-material
Magnetic multilayer for magnetic memories paper (involves MuMax3 simulation):
https://hal.science/tel-01569111/document
MuMax3 frequently asked questions:
https://mumax.ugent.be/mumax3-workshop/questions.html
https://groups.google.com/g/mumax2/c/VGWY8h9wYiQ?pli=1