Exhibit 5.1

KPMG LLP
Chartered Professional Accountants
PO Box 10426
777 Dunsmuir Street
Vancouver, BC V7Y 1K3
Tel (604) 691-3000
Fax (604) 691-3031
www.kpmg.ca
Consent of Independent Registered Public Accounting Firm
The Board of Directors
Westport Fuel Systems Inc.
We, KPMG LLP, consent to the use of our report dated March 17, 2020, on the consolidated financial statements of Westport Fuel Systems Inc. (and subsidiaries), which comprise the consolidated balance sheets as of December 31, 2019 and 2018, the related consolidated statements of operations and comprehensive income (loss), shareholders’ equity and cash flows for each of the years in the three-year period ended December 31, 2019, and the related notes, our audit report dated March 17, 2020 on the effectiveness of internal control over financial reporting each of which is incorporated by reference and to the reference to our firm under the heading “Auditors” in the short form base shelf prospectus.
Our report refers to a change in accounting policies for leases as of January 1, 2019 due to the adoption of ASC 842, Leases.
Chartered Professional Accountants
October 27, 2020
Vancouver, Canada
KPMG LLP is a Canadian limited liability partnership and a member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative (“KPMG International”), a Swiss entity. KPMG Canada provides services to KPMG LLP.