Inclusion Criteria:  STEP 0: Patients must be >= 12 months and =< 25 years of age (non-pontine tumors) OR >= 12 months and =< 21 years of age (DIPG) at the time of enrollment on Step 0.  Please note:  This age range includes pre-screening for all HGG patients. Individual treatment protocols may have different age criteria. Non-DIPG patients with tumors that do not harbor an H3K27M-mutation and are >= 18 years of age will not be eligible to enroll on ACNS1821 (Step 1). STEP 0: Patient is suspected of having localized, newly diagnosed HGG, excluding metastatic disease, OR patient has an institutional diagnosis of DIPG STEP 1: Patients must be >= 12 months and =< 21 years of age at the time of enrollment STEP 1: Patients must have newly-diagnosed DIPG or HGG (including DMG).  STEP 1: Stratum DMG (with H3 K27M mutation)  Patients must have newly-diagnosed non-pontine H3 K27M-mutant HGG without BRAF^V600 or IDH1 mutations as confirmed by Rapid Central Pathology and Molecular Screening Reviews performed on APEC14B1 Note: Patients need not have either measurable or evaluable disease, i.e., DMG patients may have complete resection of their tumor prior to enrollment. Primary spinal tumors are eligible for enrollment. For rare H3 K27M-mutant HGG in non-midline structures (e.g., cerebral hemispheres), these patients will be considered part of Stratum DMG.  STEP 1: Stratum HGG (without H3 K27M mutation)  Patients must have newly-diagnosed non-pontine H3 K27M-wild type HGG without BRAF^V600 or IDH1 mutations as confirmed by Rapid Central Pathology and Molecular Screening Reviews performed on APEC14B1  Please note:  Patients who fall in this category and who are ≥ 18 years of age are not eligible due to another standard-of-care regimen (radiation/temozolomide) that is available Patients need not have either measurable or evaluable disease, i.e., HGG patients may have complete resection of their tumor prior to enrollment. Primary spinal tumors are eligible for enrollment STEP 1: Patients must have a performance status corresponding to Eastern Cooperative Oncology Group (ECOG) scores of 0, 1 or 2. Use Karnofsky for patients > 16 years of age and Lansky for patients =<16 years of age. Patients who are unable to walk because of paralysis, but who are up in a wheelchair, will be considered ambulatory for the purpose of assessing the performance score. STEP 1: Peripheral absolute neutrophil count (ANC) >= 1000/uL Platelet count >= 100,000/uL (transfusion independent) STEP 1: Hemoglobin >= 8.0 g/dL (may receive red blood cell [RBC] transfusions) STEP 1: Creatinine clearance or radioisotope glomerular filtration rate (GFR) >= 70 mL/min/1.73 m^2 or  STEP 1: A serum creatinine based on age/gender as follows:  Age / Maximum Serum Creatinine (mg/dL)  1 to < 2 years / male: 0.6; female: 0.6 2 to < 6 years / male: 0.8; female: 0.8 6 to < 10 years / male: 1; female: 1 10 to < 13 years / male: 1.2; female: 1.2 13 to < 16 years / male: 1.5; female: 1.4 >= 16 years / male: 1.7; female: 1.4 STEP 1: Total bilirubin =< 1.5 x upper limit of normal (ULN) for age STEP 1: Serum glutamate pyruvate transaminase (SGPT) (alanine aminotransferase [ALT]) =< 135 U/L. For the purpose of this study, the ULN for SGPT is 45 U/L. STEP 1: Serum amylase =< 1.5 x ULN STEP 1: Serum lipase =< 1.5 x ULN STEP 1: No evidence of dyspnea at rest, no exercise intolerance, and a pulse oximetry > 94% if there is clinical indication for determination. STEP 1: Patients with seizure disorder may be enrolled if on anticonvulsants and well controlled. STEP 1: Patients must be enrolled and protocol therapy must begin no later than 31 days after the date of radiographic diagnosis (in the case of non-biopsied DIPG patients only) or definitive surgery, whichever is the later date (Day 0).  For patients who have a biopsy followed by resection, the date of resection will be considered the date of definitive diagnostic surgery. If a biopsy only was performed, the biopsy date will be considered the date of definitive diagnostic surgery.  STEP 0:  For patients with non-pontine tumors: Patient and/or their parents or legal guardians have signed informed consent for eligibility screening on APEC14B1 Part A. For patients with DIPG: Patient and/or their parents or legal guardians have signed informed consent for ACNS1821.  STEP 1: Stratum DIPG  Patients with newly-diagnosed typical DIPG, defined as tumors with a pontine epicenter and diffuse involvement of at least 2/3 of the pons on at least 1 axial T2 weighted image, are eligible. No histologic confirmation is required. Patients with pontine tumors that do not meet radiographic criteria for typical DIPG (e.g., focal tumors or those involving less than 2/3 of the pontine cross-sectional area with or without extrapontine extension) are eligible if the tumors are biopsied and proven to be high-grade gliomas (such as anaplastic astrocytoma, glioblastoma, high-grade glioma not otherwise specified [NOS], and/or H3 K27M-mutant) by institutional diagnosis. STEP 1: All patients and/or their parents or legal guardians must sign a written informed consent STEP 1: All institutional, Food and Drug Administration (FDA), and National Cancer Institute (NCI) requirements for human studies must be met.  Exclusion Criteria:  STEP 1: Patients must not have received any prior therapy for their central nervous system (CNS) malignancy except for surgery and steroid medications. STEP 1: Patients who are currently receiving another investigational drug are not eligible. STEP 1: Patients who are currently receiving other anti-cancer agents are not eligible. STEP 1: Patients >=18 years of age who have H3 K27M-wild type HGG. STEP 1: Patients who have an uncontrolled infection. STEP 1: Patients who have received a prior solid organ transplantation. STEP 1: Patients with Grade > 1 extrapyramidal movement disorder. STEP 1: Patients with known macular degeneration, uncontrolled glaucoma, or cataracts. STEP 1: Patients with metastatic disease are not eligible; magnetic resonance imaging (MRI) of spine with and without contrast must be performed if metastatic disease is suspected by the treating physician. STEP 1: Patients with gliomatosis cerebri type 1 or 2 are not eligible, with the exception of H3 K27M-mutant bithalamic tumors. STEP 1: Patients who are not able to receive protocol specified radiation therapy.  STEP 1:  Female patients who are pregnant are ineligible since there is yet no available information regarding human fetal or teratogenic toxicities. Lactating females are not eligible unless they have agreed not to breastfeed their infants. It is not known whether selinexor is excreted in human milk. Female patients of childbearing potential are not eligible unless a negative pregnancy test result has been obtained. Sexually active patients of reproductive potential are not eligible unless they have agreed to use two effective methods of birth control (including a medically accepted barrier method of contraception, e.g., male or female condom) for the duration of their study participation and for 90 days after the last dose of selinexor. Abstinence is an acceptable method of birth control.