Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAST-314: ⭐ Hast.Samples.Consumer GUI bug fixes and documentation housekeeping #107

Merged
merged 29 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
23dd1ad
Custom configuration handle JSON.
sarahelsaig Jul 2, 2023
57fc579
fix timing report file name for Azure Alveo U250 driver
sarahelsaig Jul 21, 2023
0e31c17
Merge remote-tracking branch 'origin/issue/HAST-175' into issue/HAST-314
sarahelsaig Jul 23, 2023
47e070e
Merge remote-tracking branch 'origin/issue/HAST-175' into issue/HAST-314
sarahelsaig Jul 25, 2023
8a86e49
Merge remote-tracking branch 'origin/dev' into issue/HAST-314
sarahelsaig Jul 27, 2023
155eced
Fix typos.
sarahelsaig Jul 27, 2023
2978e68
Update broken URLs.
sarahelsaig Jul 27, 2023
7796440
Update .NET Core 3.1 references.
sarahelsaig Jul 27, 2023
68fb662
Add missing Azure link and Nimbix outdated warning.
sarahelsaig Jul 27, 2023
bffc9dc
Update src/Hastlayer/Hast.Vitis/Docs/Nimbix.md
sarahelsaig Jul 27, 2023
98ff582
Update src/Hastlayer/Hast.Vitis/Readme.md
sarahelsaig Jul 27, 2023
8e18b30
update submodules
sarahelsaig Sep 17, 2023
e4202c3
Merge branch 'issue/HAST-314' of https://github.com/Lombiq/Hastlayer-…
sarahelsaig Sep 17, 2023
dabefcb
eliminate package downgrade
sarahelsaig Sep 17, 2023
17a4061
Add ErrorOnDuplicatePublishOutputFiles
sarahelsaig Sep 17, 2023
5f61637
Fix bug where Azure composer is not used for AzureAlveoU250Driver.
sarahelsaig Sep 24, 2023
64bd94f
Fix "The xclbin DCP file is not a netlist." bug.
sarahelsaig Sep 25, 2023
aae6d24
Restore missing driver config.
sarahelsaig Sep 25, 2023
9c25b9f
Fix crash if compilation fails the first time and passes the second t…
sarahelsaig Sep 25, 2023
ee484bf
Merge remote-tracking branch 'origin/dev' into issue/HAST-314
sarahelsaig Sep 25, 2023
9c0c7af
Include SingleBinaryPath in Hast.NuGet.Console.
sarahelsaig Sep 25, 2023
465e909
Only use xclbin files.
sarahelsaig Sep 25, 2023
e8ace03
Update NuGet packages.
sarahelsaig Sep 25, 2023
eb310ce
Add cross-compilation instructions to Hast.NuGet.Console.
sarahelsaig Sep 26, 2023
f1d0e8e
Fix package reference names.
sarahelsaig Sep 26, 2023
2f1d747
Typo
Piedone Sep 26, 2023
aa181a6
Add comment why ErrorOnDuplicatePublishOutputFiles has to be disabled.
sarahelsaig Sep 26, 2023
bb1c3e0
Typo
Piedone Sep 26, 2023
b0ebf6b
Updating submodules to merged dev
Piedone Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/HardwareFrameworks/Vitis
8 changes: 7 additions & 1 deletion src/Hastlayer/Hast.Common/Extensions/DictionaryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using Newtonsoft.Json.Linq;

namespace System.Collections.Generic;

public static class DictionaryExtensions
{
public static T GetOrAddCustomConfiguration<T>(this IDictionary<string, object> customConfiguration, string key)
where T : new()
{
if (customConfiguration.TryGetValue(key, out var config)) return (T)config;
if (customConfiguration.TryGetValue(key, out var config))
{
if (config is T typedConfig) return typedConfig;
if (config is JToken jToken) return jToken.ToObject<T>();
}

var newInstance = new T();
customConfiguration[key] = newInstance;
Expand Down
2 changes: 1 addition & 1 deletion src/Hastlayer/Hast.Vitis/Docs/Docker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker Setup

This way you can compile on your Windows machine, or any machine where you don't want to install XRT permanently. Note that you still need to download the complete Vitis XDK separately for licensing reasons and it takes about 125GB (and at least 50GB more temporarily) to set up the image. Of course you need [Docker installed](https://docs.docker.com/get-docker/) too. However there are no alternatives on Windows so please bear with it. Following these steps you will get a container with Vitis XDK and .NET Core 3.1 SDK installed. Please remember not to distribute the resulting image!
This way you can compile on your Windows machine, or any machine where you don't want to install XRT permanently. Note that you still need to download the complete Vitis XDK separately for licensing reasons and it takes about 125GB (and at least 50GB more temporarily) to set up the image. Of course you need [Docker installed](https://docs.docker.com/get-docker/) too. However there are no alternatives on Windows so please bear with it. Following these steps you will get a container with Vitis XDK and .NET SDK installed. Please remember not to distribute the resulting image!


## Installation Steps
Expand Down
4 changes: 3 additions & 1 deletion src/Hastlayer/Hast.Vitis/Docs/Nimbix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Nimbix usage


> ⚠️ The instructions below are outdated, as the mentioned Alveo trial is no longer available. Some of the names have changed since Nimbix has been acquired by Atos, and they only seem to offer enterprise solutions now. The rest of the document is retained in case it may be a useful reference for anyone who wants to use their services with Hastlayer.


To run a Hastlayer applications on the [Nimbix HPC cloud](https://www.nimbix.net/), a compute instance must be launched, the dependencies installed and the host & device applications uploaded. You can find the necessary instructions here.

Expand All @@ -10,7 +12,7 @@ Be sure to also check out the [general docs](../Readme.md).
## Administrative steps

1. Sign up for the [Nimbix Alveo Trial](https://www.nimbix.net/alveotrial).
2. [Log into the Nimbix platform](https://platform.jarvice.com/) after the registration is complete. [Here](https://support.nimbix.net/hc/en-us/articles/360035258971-Getting-Started-With-Alveo-Trial) is also some more getting started information (note that the costs indicator only updates when you shut down your job).
2. [Log into the Nimbix platform](https://cloud.nimbix.net/) after the registration is complete. [Here](https://support.nimbix.net/hc/en-us/articles/360035258971-Getting-Started-With-Alveo-Trial) is also some more getting started information (note that the costs indicator only updates when you shut down your job).
3. On the right sidebar click "Compute" and find "Xilinx Vitis Unified Software Platform 2020.1" in the search bar. At the time of writing this that option lets you pick U50, U200, and U280.
4. Activate "Desktop Mode with FPGA" and select the machine type with the appropriate board. Note that Nimbix might be overloaded and not every board you can select will actually be available, resulting in the job being queued forever. Check out the availability on the [Nimbix status page](https://status.jarvice.com/) first.
5. You should be sent to the Dashboard section with a thumbnail for the running instance.
Expand Down
2 changes: 1 addition & 1 deletion src/Hastlayer/Hast.Vitis/Interop/Xrt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Hast.Vitis.Interop;
/// <para>Source: <see href="https://github.com/Xilinx/XRT/blob/master/src/include/1_2/CL/cl_ext_xilinx.h"/>.</para>
/// <para>
/// Legacy layout is used since that's the one in the examples <see
/// href="https://github.com/Xilinx/Vitis_Accel_Examples/blob/master/host/hbm_bandwidth/src/host.cpp">here</see>.
/// href="https://github.com/Xilinx/Vitis_Accel_Examples/blob/2021.1/host/hbm_bandwidth/src/host.cpp">here</see>.
/// </para>
/// </remarks>
// LayoutKind can't be Auto because this struct is exposed to unmanaged code.
Expand Down
7 changes: 3 additions & 4 deletions src/Hastlayer/Hast.Vitis/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ This project contains the communication service used to connect with Xilinx's [V

Note that the SH scripts in this project should use LF line endings! You'll get errors such as `-bash: $'\r': command not found` otherwise.

For Nimbix-specific instructions see [the Nimbix docs](Docs/Nimbix.md).

## Requirements

* The system running the FPGA card must be 64-bit Linux (e.g. Ubuntu 18.04.2 LTS or CentOS 7.6). The installation instructions can be found here [in the platform documentation](https://www.xilinx.com/html_docs/xilinx2019_2/vitis_doc/vhc1571429852245.html).
Expand All @@ -20,7 +18,8 @@ For Nimbix-specific instructions see [the Nimbix docs](Docs/Nimbix.md).

Even after everything is installed, you have to make sure that the executing user's environment variables are correctly set by sourcing the setup scripts [as described in the documentation](https://docs.xilinx.com/r/en-US/ug1400-vitis-embedded/Setting-Up-the-Environment-to-Run-the-Vitis-Software-Platform). You can add these commands into the `~/.bashrc` file to avoid having to type them every time. If running from the cloud, like Nimbix, this is probably handled automatically.

For setup instructions on the Nimbix cloud see the [Nimbix-specific instructions](Docs/Nimbix.md).
- For Azure-specific instructions see [the Azure NP docs](Docs/AzureReadme.md).
- For Nimbix-specific instructions see [the Nimbix docs](Docs/Nimbix.md).


## Cross Compilation
Expand All @@ -45,7 +44,7 @@ Aside from general Vitis accelerator card support, there are a couple specialize

## Other Remarks

If you ever get an error *\[XRT\] ERROR: some device is already programmed* due to a crashed or interrupted execution, you can reset the card using `xbutil reset` command. See more info about the Xilinx Board Utility [here](https://www.xilinx.com/html_docs/xilinx2019_1/sdaccel_doc/yrx1536963262111.html).
If you ever get an error *\[XRT\] ERROR: some device is already programmed* due to a crashed or interrupted execution, you can reset the card using `xbutil reset` command. See more info about the Xilinx Board Utility [here](https://xilinx.github.io/XRT/master/html/xbutil.html).

If you just want to generate a simulation report, you can do that without the full build by configuring the `VitisBuildConfiguration.SynthesisOnly` custom configuration in the *appsettings.json* or by adding the following command line argument:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Task BuildAsync(
// When cross-compiling, the build machine needs Vivado and XRT, but the FPGA machine only needs XRT.
_logger.LogWarning(
"XILINX_VITIS variable is not set. This is required to build using Vivado. For further instructions " +
"see https://www.xilinx.com/html_docs/xilinx2020_1/vitis_doc/settingupvitisenvironment.html.");
"see https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Building-and-Running-the-Application.");
}

GetXilinxDirectoryPathOrThrow();
Expand Down
4 changes: 2 additions & 2 deletions src/Hastlayer/Hast.Vitis/ubuntu-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ yes | sudo apt-get --yes --force-yes install apt-transport-https
sudo apt-get update
# This installs the full SDK allowing you to build from source. If you only want to run the compiled application, you
# can install just the runtime by swapping the comment on the two lines below.
yes | sudo apt-get --yes --force-yes install dotnet-sdk-3.1
# yes | sudo apt-get --yes --force-yes install dotnet-runtime-3.1
yes | sudo apt-get --yes --force-yes install dotnet-sdk-7.0.x86_64
# yes | sudo apt-get --yes --force-yes install dotnet-runtime-7.0.x86_64



Expand Down
2 changes: 2 additions & 0 deletions src/Hastlayer/Hast.Xilinx/Drivers/AzureAlveoU250Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class AzureAlveoU250Driver : VitisDeviceDriverBase
public override string PlatformName => "xilinx_u250_gen3x16_xdma_2_1_202010_1"; // Needs a very specific version.
public override uint ClockFrequencyMhz => 300;

protected override string TimingReportFileName => nameof(AlveoU250Driver);

public AzureAlveoU250Driver(ITimingReportParser timingReportParser)
: base(timingReportParser)
{ }
Expand Down