Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1628 Discussions

Tutorial for people starting to learn devcloud

goodle06
Novice
3,621 Views

Hello!

I'm trying to run code of vector-add example and have questions, answers to which I was unable to find in tutorial or forum.

My steps so far:

1. Got connected to devcloud with Cygwin and VS Code.

2. Downloaded vector-add example with VS Code extension.

3. Created build.sh like this:

#!/bin/bash
source /opt/intel/inteloneapi/setvars.sh
cd /home/u****/test1/
make clean
make all
make run

 

4. In VS Code terminal run this command:

qsub -l nodes=1:gpu:ppn=2 -d . build.sh

5. Got this response: 

795543.v-qsvr-1.aidevcloud

and two new files in explorer:

/home/u****/test1/build.sh.e795543
/home/u****/test1/build.sh.o795543

First is empty and second:

########################################################################
#      Date:           Sun 14 Feb 2021 02:22:11 AM PST
#    Job ID:           795543.v-qsvr-1.aidevcloud
#      User:           u61376
# Resources:           neednodes=1:gpu:ppn=2,nodes=1:gpu:ppn=2,walltime=06:00:00
########################################################################


########################################################################
# End of output for job 795543.v-qsvr-1.aidevcloud
# Date: Sun 14 Feb 2021 02:22:15 AM PST
########################################################################

Questions:

1. What does response of the terminal means?

2. What is theese files? 

3. When I go to src/ folder where .cpp files are located and open one of them VS Code underlines includes of <CL/sycl.hpp>. Why and what should I do? Seems like it can't find path to this include.

4. How do I get console output for the job or any other output for that matter?

5. When I'm trying to run code with VS Code (Run without debugging) I have an error "launch: program 'enter program name, for example /home/u****/test1/a.out' does not exist". Why is that and what should I do? 

 

Labels (1)
0 Kudos
1 Solution
RaeesaM_Intel
Moderator
3,473 Views

Hi,

Thank you for your patience.


As said, the error in header file is due to IntelliSense extension in VSCode.

To rectify the error, follow the steps given below:

1) Open VSCode and connect to devcloud

2) Make sure that you have c_cpp_properties.json file in your .vscode folder in devcloud

Hint: Use the Command Palette (Ctrl+Shift+P) and type C/C++: Edit Configurations


3) Open the c_cpp_properties.json file and add include paths like this:

{

  "configurations": [

    {

      "name": "Linux",

      "includePath": [

        "/home/uxxxxx/intel/oneapi/compiler/2021.1.1/linux/include/sycl"

      ],

      "defines": [],

      "compilerPath": "/usr/bin/gcc",

      "cStandard": "gnu11",

      "cppStandard": "gnu++14",

      "intelliSenseMode": "linux-gcc-x64"

    }

  ],

  "version": 4

}


Note : Run $find -iname sycl to find the complete oneapi path for sycl

4) Save the json file and now re-open any of the .cpp file in vector-add and check whether the issue still persists.


Hope this solves the issue.

Regards,

Raeesa



View solution in original post

8 Replies
RaeesaM_Intel
Moderator
3,563 Views

Hi,

Thank you for posting in Intel Devcloud Forum.

We tried to follow the steps provided but we didn't observe any issue that you mentioned and the code is running successfully.

 

Here are the detailed steps that we followed:

  1. Connect to devcloud

          $ssh devcloud

 

  1. Create a build.sh file

          $vi build.sh

          Type the following contents of the script and save.

          #!/bin/bash

          source /opt/intel/inteloneapi/setvars.sh

          cd /home/u****/<vector-add-folder-name>/

         make clean

         make all

         make run

 

  1. Enter interactive compute node

          $qsub -I

          -I (upper case i) is the argument used to request an interactive session.

 

  1. In VScode terminal , run the following commands:

         $ qsub -l nodes=1:gpu:ppn=2 -d . build.sh

         -l nodes=1:gpu:ppn=2 (lower case L) is used to assign one full GPU node to the job.
        -d . is used to configure the current folder as the working directory for the task.
        build.sh is the script that gets executed on the compute node.

        This command submits the job to queue. Once the job enters the queue, qsub will return the job ID, in your case 795543.v-qsvr-1.aidevcloud

 

  1. To get a list of running and queued jobs, run

          $qstat

          Status R means the job is running, status Q means it is waiting in the queue. And if your job has completed , you will not see it in the queue

 

  1. Once it completes, you'll have files like build.sh.o795543 and build.sh.e795543 in your current directory, corresponding to the script output and error respectively . Here,

          Build.sh is the job name

          795543 is the job number

          build.sh.o795543  is the standard output stream of the job. We could observe that your file had no output.

          build.sh.e795543 is the standard error stream of the job . . In your case, there was no errors, so the file was blank. 

          The expected output : file attached Output.txt

          As you are submitting the script as job to devcloud queue, the output will not be displayed in the console and after the successful execution of job , there will be .o and .e files to see for outputs and errors.

 

I hope the above steps and explanation would answer your 1st , 2nd and 4th question.

Regarding question 3&5:

This might be due to not sourcing setvars.sh. So make sure that you run the following commands one by one:

$source /opt/intel/inteloneapi/setvars.sh

$cd /home/u****/<vector-add-folder-name>/

$make clean

$make all

$make run

This should work and you will get the same output as in the output.txt file in your terminal.

For more details regarding job submission, please refer :

https://devcloud.intel.com/oneapi/documentation/job-submission/

 

Hope these steps and explanation helps to solve the issue.

Regards,

Raeesa

goodle06
Novice
3,556 Views

Hello, @RaeesaM_Intel 

Thank you for detailed answer, it cleared things a lot for me. I was able to get an output by running commands one by one via VS Code terminal as you said and received result also in the terminal. 

Regarding question about VS Code underlining inclusion of <CL/sycl.hpp> - running sevtars.sh got me following warning:

:: WARNING: setvars.sh has already been run. Skipping re-execution.
To force a re-execution of setvars.sh, use the '--force' option.
Using '--force' can result in excessive use of your environment variables.

but didn't result in resolving the issue.

And submitting job with the script returns empty output file like this:

########################################################################
#      Date:           Mon 15 Feb 2021 06:12:05 AM PST
#    Job ID:           795840.v-qsvr-1.aidevcloud
#      User:           u61376
# Resources:           neednodes=1:gpu:ppn=2,nodes=1:gpu:ppn=2,walltime=06:00:00
########################################################################

:: WARNING: setvars.sh has already been run. Skipping re-execution.
   To force a re-execution of setvars.sh, use the '--force' option.
   Using '--force' can result in excessive use of your environment variables.
rm -f vector-add-buffers vector-add-usm
dpcpp -O2 -g -std=c++17 -o vector-add-buffers src/vector-add-buffers.cpp

########################################################################
# End of output for job 795840.v-qsvr-1.aidevcloud
# Date: Mon 15 Feb 2021 06:12:17 AM PST
########################################################################

 

If I understand correctly, project is built, but not run. Why is that may be?

It would be nice, if you were able to help me. 

Thank you.

0 Kudos
goodle06
Novice
3,524 Views

Update to my previous message:

Output file somehow got fixed and I recieve expected result. Only question remaining is about include underlining by VS Code. I supposed it's not that important, but if someone have any idea that would be terrific. 

0 Kudos
RaeesaM_Intel
Moderator
3,519 Views

Hi,

Happy to hear that now you got a clear idea about the steps and were able to get the output by submitting the script as a job and by running the commands separately.

 

Regarding the issue where in VScode its underlining the headerfile part :

VScode does not have any default extensions and these warnings might be due to any external extensions that you have separately installed in VScode like IntelliSense or any other cpp extensions.

Please hover over the underlined line in VScode and see the detailed error log (Attach the screenshot of the same)You will find the name of extension there. Try to edit the configuration file and give right cpp include path in VScode for that extension.

Example: If you are using IntelliSense, you can give path as given in this link  https://stackoverflow.com/questions/39430277/visual-studio-code-include-file-not-found-in-include-directory-windows-10

 

Try this out and let us know the updates.

Thank you ,

Raeesa

goodle06
Novice
3,509 Views

Hi, Raeesa @RaeesaM_Intel !

 

Yes, it's IntelliSense problem. I wonder what path should I put, do I understand correcttly that it is not local path to Intel OneAPI? If I'm right then what is correct path in devcloud?

Thanks a lot for your help!

0 Kudos
RaeesaM_Intel
Moderator
3,474 Views

Hi,

Thank you for your patience.


As said, the error in header file is due to IntelliSense extension in VSCode.

To rectify the error, follow the steps given below:

1) Open VSCode and connect to devcloud

2) Make sure that you have c_cpp_properties.json file in your .vscode folder in devcloud

Hint: Use the Command Palette (Ctrl+Shift+P) and type C/C++: Edit Configurations


3) Open the c_cpp_properties.json file and add include paths like this:

{

  "configurations": [

    {

      "name": "Linux",

      "includePath": [

        "/home/uxxxxx/intel/oneapi/compiler/2021.1.1/linux/include/sycl"

      ],

      "defines": [],

      "compilerPath": "/usr/bin/gcc",

      "cStandard": "gnu11",

      "cppStandard": "gnu++14",

      "intelliSenseMode": "linux-gcc-x64"

    }

  ],

  "version": 4

}


Note : Run $find -iname sycl to find the complete oneapi path for sycl

4) Save the json file and now re-open any of the .cpp file in vector-add and check whether the issue still persists.


Hope this solves the issue.

Regards,

Raeesa



goodle06
Novice
3,464 Views

Hello, Raeesa @RaeesaM_Intel !

 

Thank you for your answer.  I couldn't find sycl within path you mentioned, but have found it in "glob" directory. Final json looks like this:

 

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/glob/development-tools/versions/oneapi/gold/inteloneapi/compiler/2021.1.2/linux/include/sycl/"
            ],
            "defines": [],
            "compilerPath": "/glob/development-tools/versions/oneapi/gold/inteloneapi/compiler/2021.1.2/linux/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}
 
I don't know why compiler differs from what you proposed, it was like that when I opened configuration file. Everything is working fine, hope it will help someone else.
0 Kudos
RaeesaM_Intel
Moderator
3,432 Views

Hi,


The path is different because you are using the pre-installed oneAPI toolkit which is in the /glob path and mine is the one separately installed in my home directory /home/uxxxx path. Both are fine and glad to know that everything is working fine now.

Thank you for accepting the solution. We are discontinuing monitoring this thread. Please feel free to raise a new thread in case any further issues. We would be happy to help you.


Regards,

Raeesa


Reply