Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
32 Views

Using SVM for Intel Graphics Technology

Hi,

I'm writing a benchmark to compare different technologies and their performance accross various platforms (on Linux). One of the platform is an Intel Broadwell-H  (Core i7-5775C with integrated GPU Iris Pro 6200), so I'm testing the various ways to offload a code on my GPU using Cilk Plus. Right now, I'm trying to use SVM so I followed this tutorial but I'm facing some problems. Here's my code :

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <cilk/cilk.h>
#include <gfx/gfx_rt.h>

#define SIZE 64

int main(){
  int * in = (int*)_GFX_svm_alloc(sizeof(int)*SIZE);

#pragma offload target(gfx)
  _Cilk_for (int i = 0; i < SIZE; i++){
    in = 1;
  }

  for (int i = 0; i < SIZE; i++){
    assert(in == 1);
  }

  _GFX_svm_free(in);
  return 0;
}

Then I compile with

 - $ icc -qoffload-svm test.c
test.c(12): error: *GFX* pointer variable "in" in this offload region must be specified in an in/out/inout/nocpy clause
  #pragma offload target(gfx)
  ^

compilation aborted for test.c (code 2)

I thought maybe SVM is not allowed on all patforms, so compiled with

- $ icc -qoffload-arch=broadwell -qoffload-svm test.c
- $ ./a.out
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
a.out test.c:18: main: Assertion 'in == 1' failed.
Abandon (core dumped)

So I guess specifying the platform helps to compile, but the execution failed.

If I change the pragma adding inout(in : length(SIZE)), the compilation/execution works well with the first one, but with the second one we have the same execution problem. The point is : I don't want to add the inout clause, I shouldn't have to. I assume my compilation line is wrong but I can't say in which way.

So my question is : do you see something wrong in my code/compilation ?

Thanks a lot for your time,

Mathieu

0 Kudos
4 Replies
Highlighted
Employee
32 Views

Hi, Mathieu

What's your Linux graphics driver version? Have you installed the required version from

https://software.intel.com/en-us/articles/getting-started-with-compute-offload-to-intelr-graphics-te...

Could you have a try with option "-qoffload-arch=broadwell:visa3.2" ? I tried your test case on skylake on Windows, it works well.

Thanks.

0 Kudos
Highlighted
Beginner
32 Views

Hi Yolanda,

First, about the driver version :

vainfo: VA-API version: 0.99 (libva 1.7.0)
vainfo: Driver version: 16.5.1.59511-ubit

The driver came with Media Server Studio 2017. I installed it following the instructions here, for Ubuntu 16.04 based on the 4.4 kernel.

I tried using your option to compile :

- $ icc -qoffload-arch=broadwell:visa3.2 -qoffload-svm test.c
- $ ./a.out
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
a.out: test.c:18: main: Assertion 'in == 1' failed.
Abandon (core dumped)

Same as before ...

Thank you very much,

Mathieu

0 Kudos
Highlighted
32 Views

SVM is supported exclusively on Windows. Linux is not supported, unfortunately.

0 Kudos
Highlighted
Beginner
32 Views

Okay I understand. It would be nice to find this information directly on this page ... I guess the option qoffload-svm (Linux) exists because you plan to support SVM on Linux on a future release ? Could we have a time estimation ?

Thanks,

Mathieu

0 Kudos