killApplication - Kill an application on the NVIDIA target by name - MATLAB (original) (raw)

Main Content

Kill an application on the NVIDIA target by name

Syntax

Description

killApplication([hwObj](#mw%5Fa0b2991f-606b-4e10-b9d6-295d8612e6d5%5Fsep%5Fmw%5Fbcc65819-faa5-4997-9bca-35a8da7d894a),[exeName](#mw%5Fe44922fa-c8ac-400a-b12f-2e70c4d178b2)) sends the signal to operating system on the NVIDIA® target board to kill the application specified byexeName.

example

Examples

collapse all

This example shows how to launch and terminate an application on the NVIDIA Jetson™ TX2 target. This example requires a USB camera connected to the NVIDIA target.

Create a live hardware connection from the MATLAB® software to the NVIDIA hardware by using the jetson function. To create a live hardware connection object, provide the host name or IP address, user name, and password of the target board. For example:

hwobj = jetson('jetson-board-name','ubuntu','ubuntu');

Create a MATLAB function liveCapture.m that connects to the webcam on a Jetson TX2 board and displays the image on the board. This function acts as the_entry-point_ for code generation.

function liveCapture() %#codegen

% To enable code generation for hardware interfaces hwobj = jetson; w = webcam(hwobj,1,'1280x800'); d = imageDisplay(hwobj);

for k = 1:2000 % Capture the image from the webcam on hardware. img = snapshot(w); % Display image. image(d,img); end

Create a GPU code configuration object for generating an executable. Use thecoder.hardware function to create a configuration object for the Jetson platform and assign it to the Hardware property of the code configuration object cfg.

cfg = coder.gpuConfig('exe'); cfg.GenerateReport = true; cfg.Hardware = coder.hardware('NVIDIA Jetson'); cfg.CustomInclude = fullfile('codegen','exe','liveCapture','examples'); cfg.CustomSource = fullfile('codegen','exe','liveCapture','examples','main.cu');

The main.cu file is generated as part of code generation process. For this example, you can use this file without modification.

To generate CUDA® code, use the codegen command and pass the GPU code configuration object along with the liveCapture entry-point function. After the code generation takes place on the host, the generated files are copied over and built on the target.

codegen -config cfg liveCapture

Use the runApplication function to launch the executable on the TX2 board.

procID = runApplication(hwobj,'liveCapture');

Launching the executable on the target...

Executable launched successfully with process ID 12821. Displaying the simple runtime log for the executable...

To kill the executable launched:

killApplication(hwobj,'liveCapture')

Input Arguments

collapse all

Connection to a specific NVIDIA hardware board, specified as a jetson or drive object.

Name of the application to send the kill signal for, specified as a character vector.

Example: 'liveCapture.elf'

Version History

Introduced in R2019a

See Also

Functions

Objects

Topics