Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
417 Discussions

VSCode environment configurator fails.

AdamMiltonBarker
3,049 Views

Not a question just letting you know the environment configurator for VSCode does not work. Fresh install of basekit on Windows 10, command prompt works fine, when trying to start the environment in vscode it pops up with Error 1, then after that window is closed it pops up as if it has worked but it hasn't.

oneapi-bug.JPG

oneapi-bug-2.JPGoneapi-bug-3.JPG

   

0 Kudos
15 Replies
VidyalathaB_Intel
Moderator
3,007 Views

Hi,

Thanks for reaching out to us.

>>when trying to start the environment in vscode it pops up with Error 1

We have tried it from our end by installing the necessary extensions (Sample Browser for Intel oneAPI Toolkits and then Environment Configurator for Intel oneAPI Toolkits) and did not get any error while setting up the oneAPI environment in VS code.

We also checked with samples from oneAPI (version 2021.3.0) by initializing environment variables (setvars.bat), and tried running the same in VS code which worked fine.

Could you please share the steps that you have followed while configuring the environment in VS code (and also the version of the oneAPI base toolkit) as we are unable to reproduce the issue.

You can refer the following link for more details

https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-base-windows/top/run-a-sample-project-with-vscode.html

Regards,

Vidya.




0 Kudos
AdamMiltonBarker
3,002 Views

Thank you for the reply, I installed oneAPI toolkit on Windows 10 using the exe, then I added the two extensions and above images are the outcome. That is the tutorial I followed, it does not work  for me, I have gone through the article a number of times to see if I missed anything. 

0 Kudos
VidyalathaB_Intel
Moderator
2,970 Views

Hi,

Could you please tell us the version of the VS code which you are using?

we have tried with 1.58.0 version of VS code.

Regards,

Vidya.


0 Kudos
AdamMiltonBarker
2,931 Views
0 Kudos
AdamMiltonBarker
2,931 Views

I am now in 1.58 and it is exactly the same issue. 

0 Kudos
GRN2
Employee
2,954 Views
Hello,
This error is due to the fact that for some reason setvars could not be executed. I also see that the extension could not find the path automatically.
could you please specify which version of oneAPI kit you are using and the path to setvars.bat that you specified in manual mode? Is it possible to initialize the environment in the same VSCode terminal without an extension by running setvars.bat directly?
0 Kudos
AdamMiltonBarker
2,930 Views

Hi thanks for the reply, oneAPI is actually working fine on the machine, it is a fresh install on Windows 10 (2021.3) and the path is default path (C: > Program Files (x86) > Intel > oneAPI > setvars.bat   No it isn't possible to run it in terminal inside VSCode the following: "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" simply outputs "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" if I navigate to the directory and run setvars.bat I get:

PS C:\Program Files (x86)\Intel\oneAPI> setvars.bat
setvars.bat : The term 'setvars.bat' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ setvars.bat
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (setvars.bat:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Suggestion [3,General]: The command setvars.bat was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\setvars.bat". See "get-help about_Command_Precedence" for more details.
PS C:\Program Files (x86)\Intel\oneAPI> ".\setvars.bat"
.\setvars.bat
PS C:\Program Files (x86)\Intel\oneAPI>

 

0 Kudos
GRN2
Employee
2,917 Views
I'm sorry, I forgot to clarify. PowerShell is used as a terminal in VSCode. The file .bat runs something like this:
.\setvars.bat
In your case, you need to add ./ before the setvars:
PS C:\Program Files (x86)\Intel\oneAPI> .\setvars.bat
0 Kudos
AdamMiltonBarker
2,873 Views

Hi mate yes running if I navigate to the oneAPI dir in VSCode terminal and run .\setvars.bat that works fine.

0 Kudos
PaulF_IntelCorp
Employee
2,898 Views

Hi Adam, the environment setup script (setvars.bat) is a batch file that will only work from a cmd.exe session, it does not work directly in a powershell.exe session. In order to setup the oneAPI env vars in a powershell.exe session, use the following command at a PowerShell prompt:

 

cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'

 

This will cause the batch file to be run in a cmd.exe session, after which a new PowerShell session will be started which inherits the modified environment variables that were created by the cmd.exe session. If you type exit from the new PowerShell session you will lose the oneAPI environment.

 

0 Kudos
AdamMiltonBarker
2,873 Views

If I navigate to the oneAPI dir in VSCode and run .\setvars.bat it works fine. 

0 Kudos
PaulF_IntelCorp
Employee
2,902 Views

Hi Adam, our engineering team in charge of that plugin has been informed of this issue. --Paul

 

p.s. Until a fix is created, you can use the following workaround:

PS> cmd.exe "/K" '"C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && powershell'
PS> code

The first line will setup the oneAPI environment by running the setvars.bat file in a cmd.exe session, and then starting a new powershell.exe session which inherits the modified env vars. The second line then start VSCode, which will also contain the env vars. In this workaround, you will not need to use the environment configuration extension, because it will have been setup at the command-line from which you startup VSCode.

AdamMiltonBarker
2,873 Views

Capture.JPG

OK thanks I was able to now get the environment running in VSCode without that, still have the issue with the plugin though.

0 Kudos
VidyalathaB_Intel
Moderator
2,457 Views

Hi,


Thank you for your patience.


The issue raised by you has been fixed in the 2021.4 version. Please download and let us know if this resolves your issue.


Regards,

Vidya.


0 Kudos
VidyalathaB_Intel
Moderator
2,421 Views

Hi,


We are closing this thread for now. If you need any additional information from Intel please post a new question as this thread will no longer be monitored.


Regards,

Vidya.


0 Kudos
Reply