External Email - Use Caution
The lscpu output in the VM not listing AVX and AVX2 does not necessarily mean something is missing from the VM to run AVX instructions.
The Intel processor listed in your output, i7-8700K, does support AVX instructions. But AVX instructions could be disabled on your host (windows) machine preventing the VM from running them. Microsoft's own virtualization or “hyper-v” software may also be interfering with Virtualbox.
If you start the VM and open the terminal window you should see the output from the freesurfer startup script list SUBJECTS_DIR, etc. You can run the included python distribution by typing “fspython” . At the next prompt, type “import tensorflow”. I think you will get an illegal instruction error and a core dump when you do that since the VM cannot currently run AVX instructions.
developer#developer-VirtualBox:~$ fspython Python 3.6.8 (default, Apr 10 2020, 02:08:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux Type “help”, “copyright”, “credits” or “license” for more information. >>> import tensorflow … Illegal instruction … (core dumped) ...
This post describes what I think you are seeing on a Windows machine hosting an Ubuntu VM, https://secure-web.cisco.com/19O5GzeIOczV4HAYp0Qnt_9uKmjbtCZBRgyUgeds9Wu7V_o... … and this lists how to enable/disable AVX instructions … https://secure-web.cisco.com/16x1EXOU9g3xPZwbDofNjDwkp8aKV6kSl8PPbTnOAXFsM8W...
From those and other posts I would try the following on your Windows (host) machine:
1) Open the windows terminal or command line window in administrator mode
2) Enable AVX instructions with the command
BCDEDIT /set xsavedisable 0
3) Disable launching the Microsoft hypervisor
BCDEDIT /set hypervisorlaunchtype off
4) Shut down the VM and quit Virtualbox. You may want to quit all other applications as this next command may ask to reboot your machine (say yes). If you are not prompted to reboot, then manually reboot the Windows host.
5) Disable Microsoft Hyper-V
DISM /Online /Disable-Feature:Microsoft-Hyper-V
6) After your machine reboots, login and start the VM
7) In the VM Ubuntu terminal window, run “lscpu | grep avx” again and see if it lists avx, avx2
8) IF IT DOES REPORT AVX NOW, try the lines above again where you typed “fspython” followed by “import tensorflow”. This time you should not get an illegal instruction error. You can ignore any error you see about a missing library for libcuda and/or no GPU support.
- R. On Sep 3, 2022, at 13:46, daedalus39@aol.com wrote: External Email - Use Caution OK. It appears this VM (provided by the FreeSurfer developers) does not include "AVX".That is, "freesurfer_7.2.0_amd64.deb" can't run mri_segment_hypothalamic_subunits without additional setup? Is it even possible? If so, can anyone in the FS community provide some simple guidance. I am not horribly facile with Linux to begin with, but I'd really like to test the hypothal function.-Randydeveloper@developer-VirtualBox:/$ lscpu | grep avxdeveloper@developer-VirtualBox:/$ lscpu | grep avx2developer@developer-VirtualBox:/$ lscpuArchitecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 4On-line CPU(s) list: 0-3Thread(s) per core: 1Core(s) per socket: 4Socket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelCPU family: 6Model: 158Model name: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHzStepping: 13CPU MHz: 3599.998BogoMIPS: 7199.99Hypervisor vendor: KVMVirtualization type: fullL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 12288KNUMA node0 CPU(s): 0-3Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single ibrs_enhanced fsgsbase invpcid md_clear flush_l1d arch_capabilitiesdeveloper@developer-VirtualBox:/$ -----Original Message-----From: fsbuild <fsbuild@contbay.com>To: freesurfer@nmr.mgh.harvard.eduCc: daedalus39@aol.comSent: Fri, Sep 2, 2022 10:12 pmSubject: Re: [Freesurfer] Illegal Instruction (mri_segment_hypothalamic_subunits) - VM 7.2.0 External Email - Use Caution Hello Randy,The mri_segment_hypothalamic_subunits command is a python script that uses tensorflow which in turn is coded to use AVX instructions. If the VM host processor does not support AVX instructions, then you will get an illegal instruction error.You can check to see if AVX instructions are supported if this commands shows "avx" or "avx2" in the output (see screenshot for where that is the case).$ lscpu | grep avxIf AVX instructions are supported, then error can also happen if the command is incomplete.- R._______________________________________________Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduMailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1CEVAya8KDKQFfHD_Onw7klAUxX4Oo2gu4kCXHB-78LF4KZ... information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/176IszYzKAMgHnOQttsHYb9pFbTHVpmRb6Wrb3TGjyXATRG... has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1FFa02IdtAC8aGqRN_pd3lLUsU2i7Gpv6wZ34lBvvwckMU-...; .Please note that this e-mail is not secure (encrypted).. If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail. _______________________________________________Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Thank you so much for these incredibly clear instructions. I was able to“enable” AVX, disable hypervisor, and import tensorflow. Since these posts are publicly visible, I'm hoping this thread will be useful for all others who face these issues.
Thanks again -Randy xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
developer@developer-VirtualBox:/usr/local/freesurfer/7.2.0/subjects$mri_segment_hypothalamic_subunits --s WBI-FES_S_0862 --write_posteriors
Posteriors will be saved in each subject's directory.
using 1 thread
processing 1/1
segmentation saved in: /usr/local/freesurfer/7.2.0/subjects/WBI-FES_S_0862/mri/hypothalamic_subunits_seg.v1.mgz
posteriors saved in: /usr/local/freesurfer/7.2.0/subjects/WBI-FES_S_0862/mri/hypothalamic_subunits_posteriors.v1.mgz
volumes saved in: /usr/local/freesurfer/7.2.0/subjects/WBI-FES_S_0862/mri/hypothalamic_subunits_volumes.v1.csv
If you use this tool in a publication, please cite:
Automated segmentation of the hypothalamus and associatedsubunits in brain MRI
B. Billot, M. Bocchetta, E. Todd, A. V. Dalca, J. D. Rohrer,J. E. Iglesias
NeuroImage (in press)
developer@developer-VirtualBox:/usr/local/freesurfer/7.2.0/subjects$
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----Original Message----- From: fsbuild fsbuild@contbay.com To: freesurfer@nmr.mgh.harvard.edu Cc: daedalus39@aol.com Sent: Sun, Sep 4, 2022 12:35 am Subject: [Freesurfer] Enabling AVX instructions on Windows 10 (was Re: Illegal Instruction (mri_segment_hypothalamic_subunits) - VM 7.2.0
External Email - Use Caution The lscpu output in the VM not listing AVX and AVX2 does not necessarily mean something is missing from the VM to run AVX instructions.
The Intel processor listed in your output, i7-8700K, does support AVX instructions. But AVX instructions could be disabled on your host (windows) machine preventing the VM from running them. Microsoft's own virtualization or “hyper-v” software may also be interfering with Virtualbox.
If you start the VM and open the terminal window you should see the output from the freesurfer startup script list SUBJECTS_DIR, etc. You can run the included python distribution by typing “fspython” . At the next prompt, type “import tensorflow”. I think you will get an illegal instruction error and a core dump when you do that since the VM cannot currently run AVX instructions.
developer#developer-VirtualBox:~$ fspython Python 3.6.8 (default, Apr 10 2020, 02:08:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux Type “help”, “copyright”, “credits” or “license” for more information.
import tensorflow
… Illegal instruction … (core dumped) ...
This post describes what I think you are seeing on a Windows machine hosting an Ubuntu VM, https://secure-web.cisco.com/1JWaYHSEsVLgHeS2Sw19OtMLjjeJ4yidpsKg-AStwRli-Xe... … and this lists how to enable/disable AVX instructions … https://secure-web.cisco.com/1_KLA0gZ9SGkTm_vnc5z39PkXRVC5VSYs87sLuNKoPRt3zg...
From those and other posts I would try the following on your Windows (host) machine:
1) Open the windows terminal or command line window in administrator mode
2) Enable AVX instructions with the command
BCDEDIT /set xsavedisable 0
3) Disable launching the Microsoft hypervisor
BCDEDIT /set hypervisorlaunchtype off
4) Shut down the VM and quit Virtualbox. You may want to quit all other applications as this next command may ask to reboot your machine (say yes). If you are not prompted to reboot, then manually reboot the Windows host.
5) Disable Microsoft Hyper-V
DISM /Online /Disable-Feature:Microsoft-Hyper-V
6) After your machine reboots, login and start the VM
7) In the VM Ubuntu terminal window, run “lscpu | grep avx” again and see if it lists avx, avx2
8) IF IT DOES REPORT AVX NOW, try the lines above again where you typed “fspython” followed by “import tensorflow”. This time you should not get an illegal instruction error. You can ignore any error you see about a missing library for libcuda and/or no GPU support.
- R.
On Sep 3, 2022, at 13:46, daedalus39@aol.com wrote: External Email - Use Caution OK. It appears this VM (provided by the FreeSurfer developers) does not include "AVX". That is, "freesurfer_7.2.0_amd64.deb" can't run mri_segment_hypothalamic_subunits without additional setup? Is it even possible? If so, can anyone in the FS community provide some simple guidance. I am not horribly facile with Linux to begin with, but I'd really like to test the hypothal function..
-Randy
developer@developer-VirtualBox:/$ lscpu | grep avxdeveloper@developer-VirtualBox:/$ lscpu | grep avx2developer@developer-VirtualBox:/$ lscpuArchitecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 4On-line CPU(s) list: 0-3Thread(s) per core: 1Core(s) per socket: 4Socket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelCPU family: 6Model: 158Model name: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHzStepping: 13CPU MHz: 3599.998BogoMIPS: 7199.99Hypervisor vendor: KVMVirtualization type: fullL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 12288KNUMA node0 CPU(s): 0-3Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single ibrs_enhanced fsgsbase invpcid md_clear flush_l1d arch_capabilitiesdeveloper@developer-VirtualBox:/$
-----Original Message----- From: fsbuild fsbuild@contbay.com To: freesurfer@nmr.mgh.harvard.edu Cc: daedalus39@aol.com Sent: Fri, Sep 2, 2022 10:12 pm Subject: Re: [Freesurfer] Illegal Instruction (mri_segment_hypothalamic_subunits) - VM 7.2.0
External Email - Use Caution Hello Randy,The mri_segment_hypothalamic_subunits command is a python script that uses tensorflow which in turn is coded to use AVX instructions. If the VM host processor does not support AVX instructions, then you will get an illegal instruction error.You can check to see if AVX instructions are supported if this commands shows "avx" or "avx2" in the output (see screenshot for where that is the case). $ lscpu | grep avxIf AVX instructions are supported, then error can also happen if the command is incomplete. - R.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1k1J0KSJL1tScdK87P9aiSElEOAxAC_jrv56-AXwcqb8lZ4... The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/17RQs61j21_as0sDu5dSx8coSzo-DLAleXatPlcay9J77Nc...<MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/17RQs61j21_as0sDu5dSx8coSzo-DLAleXatPlcay9J77Nc... . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/1k1J0KSJL1tScdK87P9aiSElEOAxAC_jrv56-AXwcqb8lZ4...
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/1k1J0KSJL1tScdK87P9aiSElEOAxAC_jrv56-AXwcqb8lZ4... The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://secure-web.cisco.com/17RQs61j21_as0sDu5dSx8coSzo-DLAleXatPlcay9J77Nc... https://secure-web.cisco.com/17RQs61j21_as0sDu5dSx8coSzo-DLAleXatPlcay9J77NcdpzezAzQcMW1wXAF4fqgBtmZUi4wLeHdFbZ4yX1qiyUVZwL6DQ0GbwQA3VMlb4djHcn9nzhaidUxcXd8fokVwQoUVqL7LldzDP0EeHzEnxg6C-DhLlnqt54OyrDJpHB9pcupVj6RmXU0zktDPMQOooyds9pkmXzFfL3TkikRJso8UAA_h10IyGU9txIGiNKrJsj-SUmROpHXxfUEfNBA5WMNW-07QGPEfGCoNWZY7tCnDTN801QLIspNM2KN9m24sqk5VXQLjGd742-pvk2cWIWO3PLb6gLm9Vt8e_Vg/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
freesurfer@nmr.mgh.harvard.edu