Finally I installed new nvidia-drivers and the AMD SDK APP v3.0 but its only detecting my GPU.
I installed the AMD SDK app in my home-directory.
Do you know what possibly gone wrong?
CPU: model name : Intel(R) Core(TM) i7-2640M CPU # 2.80GHz
clinfo:
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 1.2 CUDA 8.0.13
Platform Name: NVIDIA CUDA
Platform Vendor: NVIDIA Corporation
Platform Extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts
Platform Name: NVIDIA CUDA
Number of devices: 1
Device Type: CL_DEVICE_TYPE_GPU
Vendor ID: 10deh
Max compute units: 1
Max work items dimensions: 3
Max work items[0]: 1024
Max work items[1]: 1024
Max work items[2]: 64
Max work group size: 1024
Preferred vector width char: 1
Preferred vector width short: 1
Preferred vector width int: 1
Preferred vector width long: 1
Preferred vector width float: 1
Preferred vector width double: 1
Native vector width char: 1
Native vector width short: 1
Native vector width int: 1
Native vector width long: 1
Native vector width float: 1
Native vector width double: 1
Max clock frequency: 1480Mhz
Address bits: 32
Max memory allocation: 268353536
Image support: Yes
Max number of images read arguments: 128
Max number of images write arguments: 8
Max image 2D width: 16384
Max image 2D height: 16384
Max image 3D width: 2048
Max image 3D height: 2048
Max image 3D depth: 2048
Max samplers within kernel: 16
Max size of kernel argument: 4352
Alignment (bits) of base address: 4096
Minimum alignment (bytes) for any datatype: 128
Single precision floating point capability
Denorms: Yes
Quiet NaNs: Yes
Round to nearest even: Yes
Round to zero: Yes
Round to +ve and infinity: Yes
IEEE754-2008 fused multiply-add: Yes
Cache type: Read/Write
Cache line size: 128
Cache size: 16384
Global memory size: 1073414144
Constant buffer size: 65536
Max number of constant args: 9
Local memory type: Scratchpad
Local memory size: 49152
Kernel Preferred work group size multiple: 32
Error correction support: 0
Unified memory for Host and Device: 0
Profiling timer resolution: 1000
Device endianess: Little
Available: Yes
Compiler available: Yes
Execution capabilities:
Execute OpenCL kernels: Yes
Execute native function: No
Queue on Host properties:
Out-of-Order: Yes
Profiling : Yes
Platform ID: 0x8d3ee00
Name: GeForce GT 520M
Vendor: NVIDIA Corporation
Device OpenCL C version: OpenCL C 1.1
Driver version: 361.28
Profile: FULL_PROFILE
Version: OpenCL 1.1 CUDA
Extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts
Related
My environment:
qt.scenegraph.general: QSG: basic render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: texture atlas dimensions: 2048x2048
qt.scenegraph.general: R/G/B/A Buffers: 8 8 8 0
qt.scenegraph.general: Depth Buffer: 24
qt.scenegraph.general: Stencil Buffer: 8
qt.scenegraph.general: Samples: 0
qt.scenegraph.general: GL_VENDOR: Imagination Technologies
qt.scenegraph.general: GL_RENDERER: PowerVR Rogue GE7800
qt.scenegraph.general: GL_VERSION: OpenGL ES 3.2 build 1.10#5187610
I am running a Hello world QML program and config as above.
QT_QPA_EGLFS_SWAPINTERVAL=0
QT_QPA_UPDATE_IDLE_TIME=0
QSG_RENDER_LOOP=basic
I test the QT_QPA_EGLFS_SWAPINTERVAL via PVRTrace https://www.imgtec.com/developers/powervr-sdk-tools/pvrtrace/
it shows the eglSwapInterval did set properly as above.
But the problem is the program stuck on 60FPS.
Why I cannot disable the V-Sync.
The short answer is that vsync behavior is entirely platform dependent. In reality eglSwapInterval() is actually just hint and it is implementation-defined whether it actually does anything at all. On most platforms it doesn't - e.g. on Android you can neither disable it nor fix FPS at 30. Suggest raising this with the platform provider.
I am deploying a Qt application to a beaglebone black that is running Stretch. I am attempting to use linuxfb with libinput to handle touch events. The touch screen input was inverted, so I set the Coordinate Transformation Matrix with a .conf file. The touch works correctly on the desktop, but is still inverted in my Qt app.
Here are my environment settings for Qt:
QT_LOGGING_RULES=*=true
QT_QPA_EGLFS_HEIGHT=600
QT_QPA_EGLFS_PHYSICAL_HEIGHT=92
QT_QPA_EGLFS_PHYSICAL_WIDTH=155
QT_QPA_EGLFS_WIDTH=1024
QT_QPA_FB_DRM=1
QT_QPA_PLATFORM=linuxfb
With the above settings, the app renders correctly and is responsive, but the touch input is inverted.
Here is the Qt console output when running with these parameters:
11:24:44: Checking available ports...
11:24:44: Found 101 free ports.
11:24:44: Starting /usr/bin/gdbserver...
11:24:44: Debugging starts
Listening on port 10000
Remote debugging from host 192.168.13.104
Process /home/debian/test created; pid = 1473
qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card0
qt.qpa.fb: DRM device /dev/dri/card0 opened
qt.qpa.eglfs.kms: Found 1 planes
qt.qpa.eglfs.kms: plane 0: id = 18 countFormats = 2 possibleCrtcs = 0x1 supported formats = XR24 AR24
qt.qpa.eglfs.kms: property 0: id = 5 name = 'type'
qt.qpa.eglfs.kms: type is ENUM, value is 1, possible values are:
qt.qpa.eglfs.kms: enum 0: Overlay - 0
qt.qpa.eglfs.kms: enum 1: Primary - 1
qt.qpa.eglfs.kms: enum 2: Cursor - 2
qt.qpa.eglfs.kms: "LVDS1" mode count: 1 crtc index: 0 crtc id: 19
qt.qpa.eglfs.kms: mode 0 1024 x 600 # 45 hz
qt.qpa.eglfs.kms: Selected mode 0 : 1024 x 600 # 45 hz for output "LVDS1"
qt.qpa.eglfs.kms: Physical size is QSizeF(155, 92) mm for output "LVDS1"
qt.qpa.eglfs.kms: Output LVDS1 can use 1 planes: 18
qt.qpa.fb: Got a new output: LVDS1
qt.qpa.eglfs.kms: Sorted screen list: QVector()
qt.qpa.fb: Got a dumb buffer for size 1024x600 and bpp 32: handle 1, pitch 4096, size 2457600
qt.qpa.fb: FB is 25 (DRM format 0x34325258), mapped at 0xb364d000
qt.qpa.fb: Got a dumb buffer for size 1024x600 and bpp 32: handle 2, pitch 4096, size 2457600
qt.qpa.fb: FB is 26 (DRM format 0x34325258), mapped at 0xb33f5000
qt.qpa.fb: QRect(0,0 1024x600) QSizeF(155, 92) 24 4
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is a keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is a keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is a keyboard
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is tagged by udev as: Mouse
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is a pointer caps
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is tagged by udev as: Touchscreen
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is a touch device
qt.qpa.input: Using xkbcommon for key mapping
I have also tried it with these environment settings:
DISPLAY=:0
QT_LOGGING_RULES=*=true
QT_QPA_EGLFS_HEIGHT=600
QT_QPA_EGLFS_INTEGRATION=eglfs_x11
QT_QPA_EGLFS_PHYSICAL_HEIGHT=92
QT_QPA_EGLFS_PHYSICAL_WIDTH=155
QT_QPA_EGLFS_WIDTH=1024
XAUTHORITY=/home/debian/.Xauthority
Using this configuration, I can only run the app if the beaglebone has a bare xsession running. The app renders correctly, but is laggy, and the touch is still inverted.
Here is the Qt console output for this configuration:
11:26:52: Checking available ports...
11:26:52: Found 101 free ports.
11:26:52: Starting /usr/bin/gdbserver...
11:26:52: Debugging starts
Listening on port 10001
Remote debugging from host 192.168.13.104
Process /home/debian/test created; pid = 1893
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_x11", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_x11"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_x11"
libEGL warning: DRI2: failed to authenticate
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is a keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is a keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is a keyboard
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is tagged by udev as: Mouse
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is a pointer caps
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is tagged by udev as: Touchscreen
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is a touch device
qt.qpa.input: Using xkbcommon for key mapping
Running on a software rasterizer (LLVMpipe), expect limited performance.
qt.opengl.diskcache: GL_ARB_get_program_binary support = 1
qt.opengl.diskcache: Supported binary format count = 0
qt.opengl.diskcache: Shader cache supported = 0
Here is my .conf that is applied to the touchscreen:
Section "InputClass"
Identifier "calibration"
MatchProduct "EP0790M09"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "TransformationMatrix" "-1.0 0.0 1.0 0.0 -1.0 1.0 0.0 0.0 1.0"
EndSection
Here is what xinput lists for the device properties:
Device 'EP0790M09':
Device Enabled (115): 1
Coordinate Transformation Matrix (116): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (270): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (271): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (272): 1, 0
libinput Send Events Mode Enabled (273): 0, 0
libinput Send Events Mode Enabled Default (274): 0, 0
Device Node (236): "/dev/input/event1"
Device Product ID (235): 0, 0
Version info:
$lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
$ uname -a
Linux beaglebone 4.4.9 #2 SMP Thu Mar 22 13:59:11 CDT 2018 armv7l GNU/Linux
How can I invert the touch input inside my qt app?
The solution ended up being to use evdev touch in my app and use QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS to fix the input events.
My final run environment ended up being:
QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:rotate=180
QT_QPA_FB_NO_LIBINPUT=1
QT_QPA_PLATFORM=linuxfb
I want to calculate space left on my embedded target.
The Arduino IDE shows this in the output window:
Sketch uses 9544 bytes (3%) of program storage space. Maximum is 262144 bytes.
avr-size has -C option that shows "xx% left":
$ avr-size -C --mcu=atmega32u4 build/myproject.hex
AVR Memory Usage
----------------
Device: atmega32u4
Program: 8392 bytes (25.6% Full)
(.text + .data + .bootloader)
Data: 2196 bytes (85.8% Full)
(.data + .bss + .noinit)
However, I'm actually writing a CMake file to develop code for an Arduino board with an Arm Cortex M0 CPU, so I use arm-none-eabi-size, which shows the code size like this:
[100%] Built target hex
text data bss dec hex filename
8184 208 1988 10380 288c build/myproject
[100%] Built target size
*** Finished ***
Is there a way to calculate the program and data space left on the device? Or do I need to regex the output and calculate percent of a hard-coded value?
If you are using arm-none-eabi toolchain, you can add linker option -Wl,--print-memory-usage which prints RAM and Flash usage in percentage. Output looks like this:
Memory region Used Size Region Size %age Used
RAM: 8968 B 20 KB 43.79%
FLASH: 34604 B 128 KB 26.40%
I am using make file generated by CubeMX, to enable this print I added the option at the end of LDFLAGS line. For CMake this thread might be useful.
I recently have restarted to program in OpenCL and faced a beignet related error when I run the program like below:
/*
Hello World for OpenCL
How to compile:
: c++ hello.cpp -lOpenCL
*/
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>
#include <string.h>
int main() {
cl_int ret;
cl_platform_id plat_id = NULL;
cl_uint ret_num_platforms;
cl_device_id dev_id = NULL;
cl_uint ret_num_devices;
cl_context context = NULL;
cl_command_queue queue = NULL;
cl_program program = NULL;
char const * kernel_cl=R"(
kernel void hello() {
printf("Hello! OpenCL!");
}
)";
size_t kernel_cl_len = strlen(kernel_cl);
ret = clGetPlatformIDs(1, &plat_id, &ret_num_platforms);
ret = clGetDeviceIDs(plat_id, CL_DEVICE_TYPE_ALL,
1, &dev_id, &ret_num_devices);
context = clCreateContext(NULL, 1, &dev_id, NULL, NULL, &ret);
queue = clCreateCommandQueue(context, dev_id, 0, &ret);
program = clCreateProgramWithSource(context, 1,
(const char**)&kernel_cl,
(const size_t*)&kernel_cl_len,
&ret);
ret = clBuildProgram(program, 1, &dev_id, NULL, NULL, NULL);
cl_kernel ker_hello;
ker_hello = clCreateKernel(program, "hello", &ret);
cl_event event;
ret = clEnqueueTask(queue, ker_hello, 0, NULL, &event);
ret = clWaitForEvents(1, &event);
ret = clReleaseKernel(ker_hello);
ret = clReleaseProgram(program);
ret = clReleaseCommandQueue(queue);
ret = clReleaseContext(context);
}
It fails with the error, drm_intel_gem_bo_context_exec() failed: No space left on device.
My compile environment is gcc 7.1.1. and OpenCl Platform is beignet 1.3.1-2 which is installed from Arch GNU+Linux packages. The using OpenCL device is Intel HD Graphics IvyBridge M GT2. And Here's my clinfo result:
Number of platforms 1
Platform Name Intel Gen OCL Driver
Platform Vendor Intel
Platform Version OpenCL 2.0 beignet 1.3
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing
Platform Extensions function suffix Intel
drm_intel_gem_bo_context_exec() failed: No space left on device
Platform Name Intel Gen OCL Driver
Number of devices 1
Device Name Intel(R) HD Graphics IvyBridge M GT2
Device Vendor Intel
Device Vendor ID 0x8086
Device Version OpenCL 1.2 beignet 1.3
Driver Version 1.3
Device OpenCL C Version OpenCL C 1.2 beignet 1.3
Device Type GPU
Device Available Yes
Device Profile FULL_PROFILE
Max compute units 16
Max clock frequency 1000MHz
Device Partition (core)
Max number of sub-devices 1
Supported partition types None, None, None
Max work item dimensions 3
Max work item sizes 512x512x512
Max work group size 512
Compiler Available Yes
Linker Available Yes
Preferred work group size multiple 16
Preferred / native vector sizes
char 16 / 8
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 8 (n/a)
float 4 / 4
double 0 / 2 (n/a)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (n/a)
Address bits 32, Little-Endian
Global memory size 2147483648 (2GiB)
Error Correction support No
Max memory allocation 1610612736 (1.5GiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Global Memory cache type Read/Write
Global Memory cache size 8192 (8KiB)
Global Memory cache line 64 bytes
Image support Yes
Max number of samplers per kernel 16
Max size for 1D images from buffer 65536 pixels
Max 1D or 2D image array size 2048 images
Base address alignment for 2D image buffers 4096 bytes
Pitch alignment for 2D image buffers 1 bytes
Max 2D image size 8192x8192 pixels
Max 3D image size 8192x8192x2048 pixels
Max number of read image args 128
Max number of write image args 8
Local memory type Local
Local memory size 65536 (64KiB)
Max constant buffer size 134217728 (128MiB)
Max number of constant args 8
Max size of kernel argument 1024
Queue properties
Out-of-order execution No
Profiling Yes
Prefer user sync for interop Yes
Profiling timer resolution 80ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
printf() buffer size 1048576 (1024KiB)
Built-in kernels __cl_copy_region_align4;__cl_copy_region_align16;__cl_cpy_region_unalign_same_offset;__cl_copy_region_unalign_dst_offset;__cl_copy_region_unalign_src_offset;__cl_copy_buffer_rect;__cl_copy_image_1d_to_1d;__cl_copy_image_2d_to_2d;__cl_copy_image_3d_to_2d;__cl_copy_image_2d_to_3d;__cl_copy_image_3d_to_3d;__cl_copy_image_2d_to_buffer;__cl_copy_image_3d_to_buffer;__cl_copy_buffer_to_image_2d;__cl_copy_buffer_to_image_3d;__cl_fill_region_unalign;__cl_fill_region_align2;__cl_fill_region_align4;__cl_fill_region_align8_2;__cl_fill_region_align8_4;__cl_fill_region_align8_8;__cl_fill_region_align8_16;__cl_fill_region_align128;__cl_fill_image_1d;__cl_fill_image_1d_array;__cl_fill_image_2d;__cl_fill_image_2d_array;__cl_fill_image_3d;block_motion_estimate_intel;
Device Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing cl_intel_motion_estimation
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Intel Gen OCL Driver
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [Intel]
clCreateContext(NULL, ...) [default] Success [Intel]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Intel Gen OCL Driver
Device Name Intel(R) HD Graphics IvyBridge M GT2
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Intel Gen OCL Driver
Device Name Intel(R) HD Graphics IvyBridge M GT2
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.11
ICD loader Profile OpenCL 2.1
My GPU seems to allow 562% use of global memory and 133% use of local memory for a simple PyOpenCL matrix addition kernel. Here is what my script prints:
GPU: GeForce GTX 670
Global Memory - Total: 2 GB
Global Memory - One Buffer: 3.750000 GB
Number of Global Buffers: 3
Global Memory - All Buffers: 11.250000 GB
Global Memory - Usage: 562.585844 %
Local Memory - Total: 48 KB
Local Memory - One Array: 32.000000 KB
Number of Local Arrays: 2
Local Memory - All Arrays: 64.000000 KB
Local Memory - Usage: 133.333333 %
If I increase global memory use much above this point, I get the error: mem object allocation failure
If I increase local memory use above this point, I get the error: invalid work group size
Why doesn't my script fail immediately when memory use of local or global exceeds 100%?
Global size is multiplied by 32, thats the error.
When clearly a float32 has 4bytes, this makes a and b arrays 4 bytes each. Not 32.
So the proper results for you would be:
Global Memory - Total: 2 GB
Global Memory - One Buffer: 0.4687500 GB
Number of Global Buffers: 3
Global Memory - All Buffers: 1.40625 GB
Global Memory - Usage: 70.3125 %
Local Memory - Total: 48 KB
Local Memory - One Array: 4.000000 KB
Number of Local Arrays: 2
Local Memory - All Arrays: 8.000000 KB
Local Memory - Usage: 16.6666666 %