Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
283 Discussions

VSCode environment configurator fails.

AdamMiltonBarker
1,486 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
1,444 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-bas...

Regards,

Vidya.




AdamMiltonBarker
1,439 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. 

VidyalathaB_Intel
Moderator
1,407 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.


AdamMiltonBarker
1,368 Views
AdamMiltonBarker
1,368 Views

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

GRN2
Employee
1,391 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?
AdamMiltonBarker
1,367 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>

 

GRN2
Employee
1,354 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
AdamMiltonBarker
1,310 Views

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

PaulF_IntelCorp
Employee
1,335 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.

 

AdamMiltonBarker
1,310 Views

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

PaulF_IntelCorp
Employee
1,339 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
1,310 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.

VidyalathaB_Intel
Moderator
894 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.


VidyalathaB_Intel
Moderator
858 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.


Reply