# Run sample applications
The following workflow shows how to get started with a graphics application on a Qualcomm device.
**Figure: Workflow of graphics applications**
## Compile and run OpenGL ES-based applications
The Platform eSDK provides an OpenGL ES-based sample application called glmark2. This application renders a variety of scenes using OpenGL ES API.
To compile and run OpenGL ES-based applications, you must have an understanding of the [OpenGL ES API](https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf).
**Prerequisites**
- Install the Platform eSDK using either of the following methods:
- [Using Qualcomm release archive](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/install-sdk.html#download-qim-platform-esdk)
- [Manually compile the Qualcomm Linux SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#generate-an-esdk)
- Establish an SSH connection from the Linux host computer to the device. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh).
- Ensure that the Weston application is running. If not, start the Weston application by running the following commands:
>
>
> mount -o remount,rw /
> export XDG_RUNTIME_DIR=/dev/socket/weston && mkdir -p $XDG_RUNTIME_DIR
> weston --idle-time=0 --continue-without-input
> Copy to clipboard
>
>
> For more information about the Weston application, see [Qualcomm Linux Display Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-18).
For information about the OpenGL ES extensions supported on Qualcomm Linux devices, see [EGL extensions](https://docs.qualcomm.com/doc/80-70020-19/topic/supported_extensions.html#supported-egl-client-extensions).
**Compile and run the glmark2 application**
1. To set the SDK environment on the Linux host computer, run the following command:
source environment-setup-armv8-2a-qcom-linux
Copy to clipboard
2. To compile and generate a binary, run the following commands:
devtool modify glmark2
devtool build glmark2
Copy to clipboard
If you encounter any umask error, set the umask to 022.
After successful compilation, you can find the output files in the `/workspace/sources/glmark2/oe-workdir/image/usr/bin` directory.
3. To push the binary to the device, run the following commands:
scp -r /workspace/sources/glmark2/oe-workdir/image/usr/bin/glmark2-es2-wayland root@[IP-address-of-device]:/tmp
Copy to clipboard
scp -r /workspace/sources/glmark2/oe-workdir/image/usr/share/glmark2 root@[IP-address-of-device]:/tmp
Copy to clipboard
4. To run the application on the device, open the SSH terminal using the IP address of the device and run the following commands:
export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1
chmod 777 /tmp/glmark2-es2-wayland
chmod -R 777 /tmp/glmark2
cd /tmp
./glmark2-es2-wayland --data-path /tmp/glmark2 -b jellyfish
Copy to clipboard
Note
To run the sample application from the UART shell, remount the file system using the following command:
mount -o remount,rw /
Copy to clipboard
## Compile and run OpenCL-based applications
The [Adreno OpenCL SDK](https://softwarecenter.qualcomm.com/#/catalog/item/Adreno_OpenCL_SDK) has many sample applications. The steps to compile and run them are the same. You can develop several applications using the Adreno OpenCL SDK. However, consider the GPU capabilities before you compile and run applications.
Note
Currently, Qualcomm Linux supports OpenCL v2.1.
The steps to run the hello world application are as follows:
**Prerequisites**
- Install the Platform eSDK using either of the following methods:
- [Using Qualcomm release archive](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/install-sdk.html#download-qim-platform-esdk)
- [Manually compile the Qualcomm Linux SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#generate-an-esdk)
- Establish an SSH connection from the Linux host computer to the device. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh).
- Download the [Adreno OpenCL SDK](https://softwarecenter.qualcomm.com/#/catalog/item/Adreno_OpenCL_SDK).
Note
You must be a registered user to download the Adreno OpenCL SDK.
For information about the OpenCL extensions supported on Qualcomm Linux devices, see [OpenCL extensions](https://docs.qualcomm.com/doc/80-70020-19/topic/supported_extensions.html#supported-opencl-extensions).
**Compile and run the hello world sample application**
1. To compile the application, run the following commands on the Linux host computer:
cd opencl-sdk
Copy to clipboard
source /environment-setup-armv8-2a-qcom-linux
Copy to clipboard
cmake -B build -DCLSDK_OPENCL_LIBRARY=$OECORE_TARGET_SYSROOT/usr/lib/libOpenCL.so -DCLSDK_DMABUFHEAP_LIBRARY=$OECORE_TARGET_SYSROOT/usr/lib/libdmabufheap.so -DOPEN_EMBEDDED=1
cmake --build build
Copy to clipboard
After you successfully compile the code, the system generates binary files in the `/build` directory.
2. To run the application, open the SSH terminal using the IP address of the device and run the following commands:
mkdir -p /tmp/data
mkdir -p /tmp/data/opencl
Copy to clipboard
Note
To run the sample application from the UART shell, remount the file system using the following command:
mount -o remount,rw /
Copy to clipboard
3. To push the binary to the device, run the following commands:
scp -r /build/* root@[IP-address-of-the device]:/tmp/data/opencl/
Copy to clipboard
scp -r /example_images/* root@[IP-address-of-the device]:/tmp/data/opencl/
Copy to clipboard
4. To start the application, run the following commands on the device using the SSH terminal:
cd /tmp/data/opencl/
mkdir out
chmod 777 ./*
echo "run hello world 2.0 opencl sdk" > hello_world_input.txt
touch out/hello_world_output.txt
cat out/hello_world_output.txt
./cl_sdk_hello_world hello_world_input.txt out/hello_world_output.txt
cat out/hello_world_output.txt
Copy to clipboard
## Compile and run X11-based applications
The X11-based applications are graphical programs designed for the X Window system, a widely used display protocol on Linux and other Unix-like OS.
**Prerequisites**
- Install the Platform eSDK using either of the following methods:
- [Using Qualcomm release archive](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/install-sdk.html#download-qim-platform-esdk)
- [Manually compile the Qualcomm Linux SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#generate-an-esdk)
- Establish an SSH connection from the Linux host computer to the device. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh).
- Install the following X11-related binaries from Gitlab:
>
>
> - Install libXt (X Toolkit Intrinsics)
>
>
>
> >
> >
> > git clone https://gitlab.freedesktop.org/xorg/lib/libxt.git
> > cd libxt
> > Copy to clipboard
> >
> >
> > source /environment-setup-armv8-2a-qcom-linux
> > Copy to clipboard
> >
> >
> > ./autogen.sh --host=aarch64-linux-gnu --prefix=/tmp/sysroots/qcs6490-rb3gen2-core-kit/usr
> > Copy to clipboard
> >
> >
> > ./configure --host=aarch64-linux-gnu --prefix=/tmp/sysroots/qcs6490-rb3gen2-core-kit/usr
> > Copy to clipboard
> >
> >
> > make
> > make install
> > cd src/.libs/
> > Copy to clipboard
> >
> >
> > cp -r libX* /tmp/sysroots/qcs6490-rb3gen2-core-kit/usr/lib
> > Copy to clipboard
> >
> >
> > cd ../../..
> > Copy to clipboard
> - Install libxmu (Miscellaneous utility functions for X11)
>
>
>
> >
> >
> > git clone https://gitlab.freedesktop.org/xorg/lib/libxmu.git
> > cd libxmu
> > Copy to clipboard
> >
> >
> > source /environment-setup-armv8-2a-qcom-linux
> > Copy to clipboard
> >
> >
> > ./autogen.sh --host=aarch64-linux-gnu --prefix=/tmp/sysroots/qcs6490-rb3gen2-core-kit/usr
> > Copy to clipboard
> >
> >
> > ./configure --host=aarch64-linux-gnu --prefix=/tmp/sysroots/qcs6490-rb3gen2-core-kit/usr
> > Copy to clipboard
> >
> >
> > make
> > make install
> > cd src/.libs/
> > Copy to clipboard
> >
> >
> > cp -r libX* /tmp/sysroots/qcs6490-rb3gen2-core-kit/usr/lib
> > Copy to clipboard
> >
> >
> > cd ../../..
> > Copy to clipboard
> - Install X development libraries for host computer
>
>
>
> >
> >
> > sudo apt-get install xorg-dev
> > Copy to clipboard
- Set up Meson
>
>
> 1. Create `aarch64-qcom-linux-meson.cross` file.
>
>
>
> >
> >
> > cd /tmp/sysroot/X86_64/usr/share/meson
> > vi aarch64-qcom-linux-meson.cross
> > Copy to clipboard
> 2. Add the following text to `aarch64-qcom-linux-meson.cross` file and save.
>
>
>
> >
> >
> > [binaries]
> > c = ['aarch64-qcom-linux-gcc', '-march=armv8.2-a+crypto', '-mbranch-protection=standard', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/tmp/sysroots/qcs6490-rb3gen2-core-kit']
> > cpp = ['aarch64-qcom-linux-g++', '-march=armv8.2-a+crypto', '-mbranch-protection=standard', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/tmp/sysroots/qcs6490-rb3gen2-core-kit']
> > ar = 'aarch64-qcom-linux-ar'
> > nm = 'aarch64-qcom-linux-nm'
> > strip = 'aarch64-qcom-linux-strip'
> > pkgconfig = 'pkg-config'
> >
> > [built-in options]
> > c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types']
> > c_link_args = ['-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed', '-Wl,-z,relro,-z,now']
> > cpp_args = []
> > cpp_link_args = ['-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed', '-Wl,-z,relro,-z,now']
> >
> > [properties]
> > needs_exe_wrapper = true
> > sys_root = '/tmp/sysroots/qcs6490-rb3gen2-core-kit'
> > [host_machine]
> > system = 'linux'
> > cpu_family = 'x86_64'
> > cpu = 'x86_64'
> > endian = 'little'
> > Copy to clipboard
> 3. Create `meson.native`.
>
>
>
> >
> >
> > cd /tmp/sysroot/X86_64/usr/share/meson
> > vi meson.native
> > Copy to clipboard
> 4. Add the following text to `meson.native` file and save.
>
>
>
> >
> >
> > [binaries]
> > c = 'gcc'
> > cpp = 'g++'
> > ar = 'ar'
> > nm = 'nm'
> > strip = 'strip'
> > readelf = 'readelf'
> > pkgconfig = 'pkg-config-native'
> >
> > [built-in options]
> > c_args = ['-isystem//tmp/sysroots/x86_64/usr/include' , '-O2', '-pipe']
> > c_link_args = ['-L//tmp/sysroots/x86_64/usr/lib', '-L//tmp/sysroots/x86_64/lib', '-Wl,-rpath-link,//tmp/sysroots/x86_64/usr/lib', '-Wl,-rpath-link,//tmp/sysroots/x86_64/lib', '-Wl,--allow-shlib-undefined', '-Wl,--dynamic-linker=//tmp/sysroots/x86_64/lib/ld-linux-x86-64.so.2']
> > cpp_args = ['-isystem//tmp/sysroots/x86_64/usr/include' , '-O2', '-pipe']
> > cpp_link_args = ['-L//tmp/sysroots/x86_64/usr/lib', '-L//tmp/sysroots/x86_64/lib', '-Wl,-rpath-link,//tmp/sysroots/x86_64/usr/lib', '-Wl,-rpath-link,/ > installed-Platform-eSDK>/tmp/sysroots/x86_64/lib', '-Wl,--allow-shlib-undefined', '-Wl,--dynamic-linker=//tmp/sysroots/x86_64/lib/ld-linux-x86-64.so.2']
> >
> > [properties]
> > sys_root = '//tmp/sysroots/x86_64'
> > Copy to clipboard
>
>
> **Compile and run the X11-based Xeyes application**
1. To compile the Xeyes application, run the following commands:
>
>
> git clone https://gitlab.freedesktop.org/xorg/app/xeyes.git
> cd xeyes
> Copy to clipboard
>
>
> source /environment-setup-armv8-2a-qcom-linux
> Copy to clipboard
>
>
> ./autogen.sh --host=aarch64-linux-gnu
> make
> Copy to clipboard
2. Open a new SSH terminal using the IP address of the device and run the following commands:
>
>
> killall weston
> export XDG_RUNTIME_DIR=/dev/socket/weston && mkdir -p $XDG_RUNTIME_DIR && weston --continue-without-input --idle-time=0 --backend=drm-backend.so --xwayland
> Copy to clipboard
3. Open the original terminal where you compiled the Xeyes application, and run the following commands:
scp -r xeyes root@[IP-address-of-device]:/etc/data
Copy to clipboard
scp -r /tmp/sysroots/qcs6490-rb3gen2-core-kit/usr/lib/ root@[IP-address-of-device]:/etc/data
Copy to clipboard
4. To run the application on the device, open the SSH terminal using the IP address of the device and run the following commands:
. /etc/profile
export XDG_RUNTIME_DIR=/dev/socket/weston
mkdir --parents $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
export WAYLAND_DISPLAY=wayland-1
export DISPLAY=:0
export LD_LIBRARY_PATH=/etc/data/lib
chmod 777 /etc/data/xeyes
./etc/data/xeyes
Copy to clipboard
**Compile and run X11-based glmark2 application**
1. To set the SDK environment run the following command in the Linux terminal:
>
>
> source /environment-setup-armv8-2a-qcom-linux
> Copy to clipboard
2. To clone the glmark2 source, run the following command:
>
>
> git clone https://github.com/glmark2/glmark2.git
> cd glmark2
> Copy to clipboard
3. To configure, run the following command:
>
>
> meson setup build -Dflavors=x11-glesv2 --prefix=$PWD/build
> Copy to clipboard
4. To compile and generate a binary, run the following command:
>
>
> ninja -C build install
> Copy to clipboard
>
>
> The generated binary file is available at: `build/bin` directory. For example, `build/src/es-glmark2`.
>
>
> The data file is available at: `build/share/glmark2`. For example, `/glmark2/source/build/share/glmark2`.
5. To start the procedure, run the following commands:
>
>
> scp -r build/bin/glmark2-es2 root@[IP-address-of-device]:/tmp
> Copy to clipboard
>
>
> scp -r build/share/glmark2 root@[IP-address-of-device]:/tmp
> Copy to clipboard
6. To run Weston, open a new SSH terminal using the IP address of the device and run the following commands:
>
>
> killall weston
> export XDG_RUNTIME_DIR=/dev/socket/weston && mkdir -p $XDG_RUNTIME_DIR && weston --continue-without-input --idle-time=0 --backend=drm-backend.so --xwayland
> Copy to clipboard
7. To run the glmark2 application, open the original SSH terminal using the IP address of the device and run the following commands:
>
>
> . /etc/profile
> chmod 777 /tmp/glmark2-es2
> chmod 777 /tmp/glmark2
> export XDG_RUNTIME_DIR=/dev/socket/weston
> mkdir --parents $XDG_RUNTIME_DIR
> chmod 0700 $XDG_RUNTIME_DIR
> export WAYLAND_DISPLAY=wayland-1
> export DISPLAY=:0
> cd /tmp/
> ./glmark2-es2 --data-path /tmp/glmark2
> Copy to clipboard
## Next steps
- [Debug graphic issues](https://docs.qualcomm.com/doc/80-70020-19/topic/debug.html#debug-graphics-issues)
- [Profile GPU performance issues](https://docs.qualcomm.com/doc/80-70020-19/topic/graphics_developer_tools.html#graphics-developer-tools)
- [Supported extensions](https://docs.qualcomm.com/doc/80-70020-19/topic/supported_extensions.html#supported-extensions)
Last Published: Jul 27, 2025
[Previous Topic
Graphics overview](https://docs.qualcomm.com/bundle/publicresource/80-70020-19/topics/graphics-overview.md) [Next Topic
Snapdragon Profiler tool](https://docs.qualcomm.com/bundle/publicresource/80-70020-19/topics/graphics_developer_tools.md)