Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4975 Discussions

Unable to build sepdk driver

Andrew_B_Intel
Employee
4,663 Views

I cannot figure out why the sepdk build-driver continues to fail with a very basic error. On a Fedora 35 machine, I installed the intel-oneapi-vtune package and the sep5 installation failed. No problem, this has happened before so I started installing it using the instructions here: https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/set-up-analysis-target/linux-targets/build-install-sampling-drivers-for-linux-targets.html. But this fails due to it not knowing where to find stddef.h, which is very surprising. Can someone point me to what is going wrong here?

 

$ sudo vim /etc/yum.repos.d/oneapi.repo

$ sudo dnf install intel-oneapi-vtune

$ systemctl status sep5.service

...

ERROR: sep5 driver "sep5-x32_64-5.16.14-200.fc35.x86_64smp.ko"
was not found in directory "." !
This means you may need to build sep5 driver from the provided
driver sources. Please see the driver README for instructions.
Note: Ensure that the driver is built for kernel version 5.16.14-200.fc35.x86_64

$ cd /opt/intel/oneapi/vtune/latest/sepdk/src

$ gcc --version
gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)

$ sudo ./build-driver -ni
[sudo] password for abrown:
Domain Controller unreachable, using cached credentials instead. Network resources may be unavailable
C compiler version: 11.2.1
Make version: 4.3
Kernel version: 5.16.14-200

Cleaning workspaces ...
Done

Building socperf driver ...
Skipping BTF generation for /opt/intel/oneapi/vtune/2022.1.0/sepdk/src/socperf/src/socperf3.ko due to unavailability of vmlinux
Done

Building sep driver ...
In file included from /opt/intel/oneapi/vtune/2022.1.0/sepdk/src/cpumon.c:47:
/opt/intel/oneapi/vtune/2022.1.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
36 | #include <stddef.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /opt/intel/oneapi/vtune/2022.1.0/sepdk/src/cpumon.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/intel/oneapi/vtune/2022.1.0/sepdk/src/lwpmudrv.c:86:
/opt/intel/oneapi/vtune/2022.1.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
36 | #include <stddef.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /opt/intel/oneapi/vtune/2022.1.0/sepdk/src/lwpmudrv.o] Error 1
make[1]: *** [Makefile:1850: /opt/intel/oneapi/vtune/2022.1.0/sepdk/src] Error 2
make: *** [Makefile:215: default] Error 2

Failed to build the drivers

 

0 Kudos
1 Solution
Andrew_B_Intel
Employee
4,165 Views

I was able to get VTune 2022.2 to work on Fedora 35 with some help from Vishnu et al. in some internal discussions. Let me describe all of the steps here in one place in case anyone else attempts to do this. I hope that in future releases the installation is improved.

  1. install the entire base kit, not the separate VTune package; without this, the kernel drivers fail to build: sudo dnf install intel-basekit
  2. The kernel drivers will still fail to build automatically, so we must build them manually; unfortunately, the pax build script uses shell syntax that Fedora does not recognize, so the following patch is needed:
    diff --git a/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver b/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    index c2a3ae5..c499fe3 100755
    --- a/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    +++ b/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    @@ -349,10 +349,10 @@ get_absolute_path()
    {
    target_dir=$1
    if [ -d ${target_dir} ] ; then
    - cd ${SCRIPT_DIR} -
    - cd ${target_dir} -
    + cd ${SCRIPT_DIR}
    + cd ${target_dir}
    actual_dir=$PWD
    - cd ${SCRIPT_DIR} -
    + cd ${SCRIPT_DIR}
    echo "${actual_dir}"
    else
    echo "${target_dir}"
  3. Now the kernel drivers should build: sudo <path to vtune>/sepdk/src/build-driver -ni
  4. The kernel drivers will not load, however, so we must either sign them OR turn off secure boot; I chose to sign them by following the Fedora 35 Machine Owner Key route. Remember to reboot, enter the UEFI menu, and enable the new signing key there! Then sign each of the *.ko modules under the sepdk directory: sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 <path to>/private_key.priv <path to>/public_key.der <path to vtune>/sepdk/src/<path to each kernel module>.ko
  5. Now the kernel drivers should load successfully: sudo <path to vtune>/sepdk/src/insmod-sep
  6. Run VTune!

VTune will try to load all of these kernel drivers at boot time using systemd; right now, sudo systemctl restart sep5 fails with a permission error (once I hack around some more unsupported shell syntax). So for now I will manually install the kernel modules with insmod-sep. Hopefully this helps anyone else running into the same issue. VTune team: please make this process less painful!

View solution in original post

0 Kudos
14 Replies
JaideepK_Intel
Moderator
4,543 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Please refer to the below link:

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/vtune-profiler-system-requirements.html

centos7_deprecation.JPG

Since your OS is deprecated for the VTune2022.1, maybe that is causing this issue. You can try downgrading your Vtune version or you can try on a different OS and let us know.

 

Thanks,

Jaideep

 

 

0 Kudos
Andrew_B_Intel
Employee
4,530 Views

Jaideep, thanks for the link. I think we should up-level a request to provide some kind of support for Fedora--here's why: I have two Fedora 35 machines and one has a working VTune 2022.1 installed and the other (mentioned above). I don't know how the first one has a working installation (maybe it was an upgrade, maybe I installed the entire base toolkit?) but its existence indicates that it isn't impossible to get VTune 2022.1 working on Fedora. I propose we at least document a way to get VTune working for Fedora with the clear warning that the user is "on their own." Or even better, just support Fedora--why drop it?

0 Kudos
Andrew_B_Intel
Employee
4,529 Views

Correction: I have two Fedora 35 machines and one has a working VTune 2022.1 installed and the other (mentioned above) does not.

0 Kudos
JaideepK_Intel
Moderator
4,422 Views

Hi,

 

stddef.h: No such file or directory: This error maybe because of some conflicts in the gcc-g++ packages. Could you please install Basetoolkit in your machine and try again?

 

Thanks,

Jaideep

 

0 Kudos
Andrew_B_Intel
Employee
4,385 Views

Jaideep, thanks that fixed the build issue for me.

 

$ sudo dnf remove intel-oneapi-vtune
$ sudo dnf install intel-basekit

I can now build all of the drivers (hooray!) but run into the following failure when attempting to actually load the modules:

 

$ sudo ./insmod-sep -r
...

The PAX service is not loaded anymore.
--------------------- Loading PAX driver ---------------------
Checking for PMU arbitration service (PAX) ... not detected.
Attempting to start PAX service ...
Executing: insmod ./pax/pax-x32_64-5.16.14-200.fc35.x86_64smp.ko
insmod: ERROR: could not insert module ./pax/pax-x32_64-5.16.14-200.fc35.x86_64smp.ko: Key was rejected by service

ERROR: pax driver failed to load!

...

 

I attempted to self-sign pax-x32_64-5.16.14-200.fc35.x86_64smp.ko following the steps outlined here: https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/kernel-module-driver-configuration/Working_with_Kernel_Modules/#sect-signing-kernel-module-with-the-private-key. But there is no change in result: the signed pax module is still rejected. What to do about this? Is the recommendation to turn off kernel signing or is something else going on here?

 

 

0 Kudos
JaideepK_Intel
Moderator
4,322 Views

Hi Andrew,

 

Building the driver using the below command:

 

sudo <oneapi_install_directory>/vtune/latest/sepdk/src/build-driver

 

(eg:/opt/intel/oneapi/vtune/latest/sepdk/src/build-driver)

 

The driver build will be successful. Once this is done, load the drivers by running the following commands

 

sudo <oneapi_install_directory>/vtune/latest/sepdk/src/insmod-sep
sudo <oneapi_install_directory>/vtune/latest/sepdk/src/socwatch/insmod-socwatch

 

You can check the status of the loaded drivers using the below command:

 

sudo <oneapi_install_directory>/vtune/latest/sepdk/src/insmod-sep -q

 

still, if you see the below error:

pax driver is not loaded.

 

sudo <oneapi_install_directory>/vtune/latest/sepdk/src/pax/insmod-pax

 

With the below command, you can verify if all the drivers are loaded properly or not.

 

sudo <oneapi_install_directory>/vtune/latest/sepdk/src/insmod-sep -q

 

 

I hope this resolves your issue.

 

Thanks,

Jaideep

 

 

0 Kudos
Andrew_B_Intel
Employee
4,300 Views

Jaideep: as mentioned previously, now that I install the entire basekit I can build the drivers using `sepdk/src/build-driver`--this seems to work OK now. The issue is running `sepdk/src/insmod-sep`: I get the "Key was rejected by service" error. I get the same error when I run `sepdk/src/pax/insmod-pax`. I have attempted to sign the pax kernel module unsuccessfully--any other recommendations?

0 Kudos
JaideepK_Intel
Moderator
4,235 Views

Hi,

 

We apologize for the delay. Pax driver is actually part of SEP. VTune drivers are unsigned and a secure boot requires cryptographically signed drivers to be used. Could you please share the self-checker log?

Running self-checker:

sh <oneapi_install_directory>/vtune/latest/bin64/vtune-self-checker.sh

(eg: sh /opt/intel/oneapi/vtune/latest/bin64/vtune-self-checker.sh)

 

Thanks,

Jaideep

 

0 Kudos
Andrew_B_Intel
Employee
4,166 Views

I was able to get VTune 2022.2 to work on Fedora 35 with some help from Vishnu et al. in some internal discussions. Let me describe all of the steps here in one place in case anyone else attempts to do this. I hope that in future releases the installation is improved.

  1. install the entire base kit, not the separate VTune package; without this, the kernel drivers fail to build: sudo dnf install intel-basekit
  2. The kernel drivers will still fail to build automatically, so we must build them manually; unfortunately, the pax build script uses shell syntax that Fedora does not recognize, so the following patch is needed:
    diff --git a/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver b/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    index c2a3ae5..c499fe3 100755
    --- a/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    +++ b/opt/intel/oneapi/vtune/2022.2.0/sepdk/src/pax/build-driver
    @@ -349,10 +349,10 @@ get_absolute_path()
    {
    target_dir=$1
    if [ -d ${target_dir} ] ; then
    - cd ${SCRIPT_DIR} -
    - cd ${target_dir} -
    + cd ${SCRIPT_DIR}
    + cd ${target_dir}
    actual_dir=$PWD
    - cd ${SCRIPT_DIR} -
    + cd ${SCRIPT_DIR}
    echo "${actual_dir}"
    else
    echo "${target_dir}"
  3. Now the kernel drivers should build: sudo <path to vtune>/sepdk/src/build-driver -ni
  4. The kernel drivers will not load, however, so we must either sign them OR turn off secure boot; I chose to sign them by following the Fedora 35 Machine Owner Key route. Remember to reboot, enter the UEFI menu, and enable the new signing key there! Then sign each of the *.ko modules under the sepdk directory: sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 <path to>/private_key.priv <path to>/public_key.der <path to vtune>/sepdk/src/<path to each kernel module>.ko
  5. Now the kernel drivers should load successfully: sudo <path to vtune>/sepdk/src/insmod-sep
  6. Run VTune!

VTune will try to load all of these kernel drivers at boot time using systemd; right now, sudo systemctl restart sep5 fails with a permission error (once I hack around some more unsupported shell syntax). So for now I will manually install the kernel modules with insmod-sep. Hopefully this helps anyone else running into the same issue. VTune team: please make this process less painful!

0 Kudos
AckoftOvak
Beginner
3,867 Views

Didn't work for me. Manjaro 21.2.6.

$ sudo ./build-driver -ni
C compiler version: 11.2.0
Make version: 4.3
Kernel version: 5.17.1-3-MANJARO

Cleaning workspaces ...
Done

Building socperf driver ...
Done

Building sep driver ...
In file included from /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/cpumon.c:47:
/opt/intel/oneapi/vtune/2022.0.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
   36 | #include <stddef.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:288: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/cpumon.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/lwpmudrv.c:86:
/opt/intel/oneapi/vtune/2022.0.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
   36 | #include <stddef.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:288: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/lwpmudrv.o] Error 1
make[1]: *** [Makefile:1831: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src] Error 2
make: *** [Makefile:215: default] Error 2

Failed to build the drivers
0 Kudos
Andrew_B_Intel
Employee
3,849 Views

You installed the entire basekit? The error you posted is similar to the one I initially had and that seemed to be resolved by installing more of oneAPI tools; I didn't dig into it more than this, since the error went away. But you might want to check that the necessary build environment is set up by sourcing the various environment scripts?

0 Kudos
AckoftOvak
Beginner
3,842 Views

I have everything from the Base Toolkit installed besides "FPGA Add-on", and use toolkit's own `setvars.sh` to set up the environment.

[some-computer sepdk]# cd /opt/intel/oneapi/vtune/2022.0.0/sepdk/src
[some-computer src]# . /opt/intel/oneapi/setvars.sh
 
:: initializing oneAPI environment ...
   bash: BASH_VERSION = 5.1.16(1)-release
   args: Using "$@" for setvars.sh arguments: 
:: advisor -- latest
:: ccl -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vpl -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
 
[some-computer src]# ./build-driver -ni
C compiler version: 11.2.0
Make version: 4.3
Kernel version: 5.17.1-3-MANJARO

Cleaning workspaces ... 
Done

Building socperf driver ... 
Done

Building sep driver ... 
In file included from /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/cpumon.c:47:
/opt/intel/oneapi/vtune/2022.0.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
   36 | #include <stddef.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:288: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/cpumon.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/lwpmudrv.c:86:
/opt/intel/oneapi/vtune/2022.0.0/sepdk/src/inc/apic.h:36:10: fatal error: stddef.h: No such file or directory
   36 | #include <stddef.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:288: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src/lwpmudrv.o] Error 1
make[1]: *** [Makefile:1831: /opt/intel/oneapi/vtune/2022.0.0/sepdk/src] Error 2
make: *** [Makefile:215: default] Error 2

Failed to build the drivers

[some-computer src]#
0 Kudos
Andrew_B_Intel
Employee
3,835 Views

Hm, yeah; not sure what the issue is. I'm also just a user of VTune here. You'll probably want to open a separate issue for this since Manjaro is a different OS. I'm interested to see what the root cause of this is, though.

0 Kudos
JaideepK_Intel
Moderator
4,133 Views

Hi Andrew,

 

Glad to know that your issue is resolved. Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

 

Thanks,

Jaideep

 

0 Kudos
Reply