Skip to content

Commit 4605486

Browse files
authored
update actions.js (#3204)
1 parent e8c0a09 commit 4605486

File tree

1 file changed

+137
-85
lines changed

1 file changed

+137
-85
lines changed

_scripts/actions.js

Lines changed: 137 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,31 @@ $(document).ready(function() {
202202
items.push(item);
203203
}
204204
if(data.system_requirements.software.basekit != null) {
205-
var item = {};
206-
item["Software"] = "Intel® oneAPI Base Toolkit";
207-
item["Version"] = data.system_requirements.software.basekit;
208-
items.push(item);
205+
var applyto = data.system_requirements.software.basekit.applyto;
206+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
207+
var item = {};
208+
item["Software"] = "Intel® oneAPI Base Toolkit";
209+
item["Version"] = data.system_requirements.software.basekit.version;
210+
items.push(item);
211+
}
209212
}
210213
if(data.system_requirements.software.basekit_hotfix != null) {
211-
var item = {};
212-
item["Software"] = "Intel® oneAPI Base Toolkit Hotfix";
213-
item["Version"] = data.system_requirements.software.basekit_hotfix;
214-
items.push(item);
214+
var applyto = data.system_requirements.software.basekit_hotfix.applyto;
215+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
216+
var item = {};
217+
item["Software"] = "Intel® oneAPI Base Toolkit Hotfix";
218+
item["Version"] = data.system_requirements.software.basekit_hotfix;
219+
items.push(item);
220+
}
221+
}
222+
if(data.system_requirements.software.pti != null) {
223+
var applyto = data.system_requirements.software.basekit.applyto;
224+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
225+
var item = {};
226+
item["Software"] = "Intel® Profiling Tools Interfaces for GPU (PTI for GPU)";
227+
item["Version"] = data.system_requirements.software.pti.version;
228+
items.push(item);
229+
}
215230
}
216231
if(data.system_requirements.software.python != null) {
217232
var item = {};
@@ -266,86 +281,111 @@ $(document).ready(function() {
266281
indexb += 1;
267282
}
268283
if(data.preparation.basekit != null) {
269-
ret += "<div class=\"simple\">";
270-
ret += "<h3>" + $.secid_gen([indexa, indexb]) + "Install Intel® oneAPI Base Toolkit</h3>";
271-
var notes = [];
272-
// if(data.preparation.basekit.notinstall != null) {
273-
// var note = "<p>Do NOT install the following Intel® oneAPI Base Toolkit components:</p>";
274-
// note += $.ul_gen(data.preparation.basekit.notinstall);
275-
// notes.push(note);
276-
// }
277-
var activate_script = "setvars.sh";
278-
if(data.os == "Windows")
279-
activate_script = "setvars.bat";
280-
var note = "<p>Use either individual component-specific activation scripts to activate required components listed below one-by-one, or use the oneAPI bundle script <code>" + activate_script + "</code> to activate the whole oneAPI environment. Check the <i>Sanity Test</i> section below for a usage example.</p>";
281-
if($.pkgInArray(data.package, ["source"])) {
282-
var note = "<p>Use individual component-specific activation scripts to activate required components listed below one-by-one. Check the <i>Sanity Test</i> section below for a usage example.</p>";
284+
var applyto = data.system_requirements.software.basekit.applyto;
285+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
286+
ret += "<div class=\"simple\">";
287+
ret += "<h3>" + $.secid_gen([indexa, indexb]) + "Install Intel® oneAPI Base Toolkit</h3>";
288+
var notes = [];
289+
// if(data.preparation.basekit.notinstall != null) {
290+
// var note = "<p>Do NOT install the following Intel® oneAPI Base Toolkit components:</p>";
291+
// note += $.ul_gen(data.preparation.basekit.notinstall);
292+
// notes.push(note);
293+
// }
294+
var activate_script = "setvars.sh";
295+
if(data.os == "Windows")
296+
activate_script = "setvars.bat";
297+
var note = "<p>Use either individual component-specific activation scripts to activate required components listed below one-by-one, or use the oneAPI bundle script <code>" + activate_script + "</code> to activate the whole oneAPI environment. Check the <i>Sanity Test</i> section below for a usage example.</p>";
298+
if($.pkgInArray(data.package, ["source"])) {
299+
var note = "<p>Use individual component-specific activation scripts to activate required components listed below one-by-one. Check the <i>Sanity Test</i> section below for a usage example.</p>";
300+
}
301+
notes.push(note);
302+
if(data.preparation.msvc != null &&
303+
$.pkgInArray(data.package, ["source", "cppsdk"]))
304+
notes.push("Make sure the installation includes Miscrosoft C++ Build Tools integration.");
305+
if(data.preparation.basekit.notes != null)
306+
notes = $.merge(notes, data.basekit.notes);
307+
ret += $.notes_gen(notes);
308+
309+
if(data.preparation.basekit.install != null) {
310+
ret += "<p>The following Intel® oneAPI Base Toolkit components are required:</p>";
311+
var components = [];
312+
$.each(data.preparation.basekit.install, function(index, value) {
313+
placeholder_example = "";
314+
if(value.placeholder_example != null)
315+
placeholder_example = ", <i>e.g. " + value.placeholder_example + "</i>";
316+
components.push(value.name + " (<b>Placeholder <cite>" + value.placeholder + "</cite></b> as its installation path" + placeholder_example + ")");
317+
});
318+
ret += $.ul_gen(components);
319+
320+
if(data.os == "Linux/WSL2") {
321+
var linux_dist = [];
322+
$.each(data.preparation.basekit.install, function(index0, value0) {
323+
if(value0.package != null && value0.package[data.os] != null) {
324+
$.each(Object.keys(value0.package[data.os]), function(index1, value1) {
325+
if(!$.pkgInArray(value1, linux_dist)) {
326+
linux_dist.push(value1);
327+
}
328+
});
329+
}
330+
});
331+
if(linux_dist.length > 0) {
332+
ret += "<p>Recommend using a <b>package manager</b> like apt, yum or dnf to install the packages above. <b>Follow instructions at <a href=\"https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux\">Intel® oneAPI Base Toolkit Download page</a> to setup the package manager repository.</b></p>";
333+
ret += "<p>Take reference to commands below to install the packages on individual Linux distributions.</p>";
334+
$.each(linux_dist, function(index0, value0) {
335+
var packages = [];
336+
$.each(data.preparation.basekit.install, function(index1, value1) {
337+
if(value1.package != null && value1.package[data.os] != null && value1.package[data.os][value0] != null) {
338+
packages.push(value1.package[data.os][value0]);
339+
}
340+
});
341+
if(packages.length > 0) {
342+
ret += "<p>* " + value0 + "</p>";
343+
var command = "";
344+
if(value0 == "Ubuntu")
345+
command += "sudo apt install -y ";
346+
if(value0 == "RHEL")
347+
command += "sudo dnf install -y ";
348+
if(value0 == "SUSE")
349+
command += "sudo zypper install -y --oldpackage ";
350+
command += packages.join(" ");
351+
ret += $.code_gen([command]);
352+
}
353+
});
354+
}
355+
}
356+
}
357+
ret += "</div>";
358+
indexb += 1;
283359
}
284-
notes.push(note);
285-
if(data.preparation.msvc != null &&
286-
$.pkgInArray(data.package, ["source", "cppsdk"]))
287-
notes.push("Make sure the installation includes Miscrosoft C++ Build Tools integration.");
288-
if(data.preparation.basekit.notes != null)
289-
notes = $.merge(notes, data.basekit.notes);
290-
ret += $.notes_gen(notes);
291-
292-
if(data.preparation.basekit.install != null) {
293-
ret += "<p>The following Intel® oneAPI Base Toolkit components are required:</p>";
360+
}
361+
if(data.system_requirements.software.basekit_hotfix != null) {
362+
var applyto = data.system_requirements.software.basekit.applyto;
363+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
364+
ret += "<div class=\"simple\">";
365+
ret += "<h3>" + $.secid_gen([indexa, indexb]) + "Install Intel® oneAPI Base Toolkit Hotfix</h3>";
366+
ret += "<p>Follow the link above to install Intel® oneAPI Base Toolkit Hotfix</p>";
367+
ret += "</div>";
368+
indexb += 1;
369+
}
370+
}
371+
if(data.system_requirements.software.pti != null) {
372+
var applyto = data.system_requirements.software.basekit.applyto;
373+
if(applyto == null || applyto != null && $.pkgInArray(data.package, applyto)) {
374+
ret += "<div class=\"simple\">";
375+
ret += "<h3>" + $.secid_gen([indexa, indexb]) + "Install Intel® Profiling Tools Interfaces for GPU (PTI for GPU)</h3>";
376+
ret += "<p>Follow the link above to download and install Intel® Profiling Tools Interfaces for GPU (PTI for GPU).</p>";
377+
ret += "<p>The following Intel® Profiling Tools Interfaces for GPU (PTI for GPU) component is required:</p>";
294378
var components = [];
295-
$.each(data.preparation.basekit.install, function(index, value) {
379+
$.each(data.preparation.pti.install, function(index, value) {
296380
placeholder_example = "";
297381
if(value.placeholder_example != null)
298382
placeholder_example = ", <i>e.g. " + value.placeholder_example + "</i>";
299383
components.push(value.name + " (<b>Placeholder <cite>" + value.placeholder + "</cite></b> as its installation path" + placeholder_example + ")");
300384
});
301385
ret += $.ul_gen(components);
302-
303-
if(data.os == "Linux/WSL2") {
304-
var linux_dist = [];
305-
$.each(data.preparation.basekit.install, function(index0, value0) {
306-
if(value0.package != null && value0.package[data.os] != null) {
307-
$.each(Object.keys(value0.package[data.os]), function(index1, value1) {
308-
if(!$.pkgInArray(value1, linux_dist)) {
309-
linux_dist.push(value1);
310-
}
311-
});
312-
}
313-
});
314-
if(linux_dist.length > 0) {
315-
ret += "<p>Recommend using a <b>package manager</b> like apt, yum or dnf to install the packages above. <b>Follow instructions at <a href=\"https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux\">Intel® oneAPI Base Toolkit Download page</a> to setup the package manager repository.</b></p>";
316-
ret += "<p>Take reference to commands below to install the packages on individual Linux distributions.</p>";
317-
$.each(linux_dist, function(index0, value0) {
318-
var packages = [];
319-
$.each(data.preparation.basekit.install, function(index1, value1) {
320-
if(value1.package != null && value1.package[data.os] != null && value1.package[data.os][value0] != null) {
321-
packages.push(value1.package[data.os][value0]);
322-
}
323-
});
324-
if(packages.length > 0) {
325-
ret += "<p>* " + value0 + "</p>";
326-
var command = "";
327-
if(value0 == "Ubuntu")
328-
command += "sudo apt install -y ";
329-
if(value0 == "RHEL")
330-
command += "sudo dnf install -y ";
331-
if(value0 == "SUSE")
332-
command += "sudo zypper install -y --oldpackage ";
333-
command += packages.join(" ");
334-
ret += $.code_gen([command]);
335-
}
336-
});
337-
}
338-
}
386+
ret += "</div>";
387+
indexb += 1;
339388
}
340-
ret += "</div>";
341-
indexb += 1;
342-
}
343-
if(data.system_requirements.software.basekit_hotfix != null) {
344-
ret += "<div class=\"simple\">";
345-
ret += "<h3>" + $.secid_gen([indexa, indexb]) + "Install Intel® oneAPI Base Toolkit Hotfix</h3>";
346-
ret += "<p>Follow the link above to install Intel® oneAPI Base Toolkit Hotfix</p>";
347-
ret += "</div>";
348-
indexb += 1;
349389
}
350390
}
351391

@@ -537,17 +577,29 @@ $(document).ready(function() {
537577
!$.pkgInArray(data.package, ["cppsdk"])) {
538578
ret += "<div class=\"simple\">";
539579
ret += "<h2>" + $.secid_gen([indexa]) + "Sanity Test</h2>";
580+
ret += "<p>You can run a simple sanity test to double confirm if the correct version is installed, and if the software stack can get correct hardware information onboard your system. The command should return PyTorch* and Intel® Extension for PyTorch* versions installed, as well as GPU card(s) information detected.</p>";
540581
var commands = [];
582+
var print_flag = false;
541583
if(data.system_requirements.software.basekit != null &&
542584
data.preparation.basekit.install != null &&
543-
!$.pkgInArray(data.package, ["docker"])) {
544-
ret += "<p>You can run a simple sanity test to double confirm if the correct version is installed, and if the software stack can get correct hardware information onboard your system. The command should return PyTorch* and Intel® Extension for PyTorch* versions installed, as well as GPU card(s) information detected.</p>";
545-
ret += "<p>Check section <b><i>Install Intel® oneAPI Base Toolkit</i></b> for <b>placeholders</b> used below.</p>";
585+
!$.pkgInArray(data.package, ["docker"]) &&
586+
data.system_requirements.software.basekit.applyto == null) {
587+
print_flag = true;
588+
}
589+
if(print_flag) {
590+
ret += "<p>Check section <b><i>Install Intel® oneAPI Base Toolkit</i></b> ";
591+
if(data.preparation.pti != null) {
592+
ret += "and <b><i>Install Intel® Profiling Tools Interfaces for GPU (PTI for GPU)</i></b> ";
593+
}
594+
ret += "for <b>placeholders</b> used below.</p>";
546595
$.each(data.preparation.basekit.install, function(index, value) {
547596
commands.push(value.env);
548597
});
549-
} else {
550-
ret += "<p>You can run a simple sanity test to double confirm if the correct version is installed. The command should return PyTorch* and Intel® Extension for PyTorch* versions installed.</p>";
598+
if(data.preparation.pti != null) {
599+
$.each(data.preparation.pti.install, function(index, value) {
600+
commands.push(value.env);
601+
});
602+
}
551603
}
552604
commands.push(data.sanity_test);
553605
ret += $.code_gen(commands);
@@ -672,7 +724,7 @@ $(document).ready(function() {
672724
var pair = encodeURIComponent(key) + "=" + encodeURIComponent(query_json[key]);
673725
hashes.push(pair.toLowerCase());
674726
}
675-
}
727+
}
676728
window.location.hash = "#installation?" + hashes.join("&");
677729
var formdata = new FormData();
678730
formdata.append("query", query);

0 commit comments

Comments
 (0)