With the release of Vitis version 2023.2, the IDE transitioned from being based on the Eclipse IDE to Microsoft's open source version of Visual Studio IDE, Visual Studio Code aka VS Code. As an FPGA developer living more so on the low level firmware and hardware side of things, it had been several years since I had used Visual Studio. In fact, VS Code didn't even exist the last time I used Visual Studio.
So needless to say, it's been quite the adjustment for me over the past month I've been using Vitis 2023.2 in getting to know the in's and out's of the VS Code instance running under the hood of Vitis Unified. While it hasn't been a rough transition by any means, I did wake up one morning to an interesting roadblock when I tried to launch Vitis to continue working on my Vector Addition Accelerated Application Tutorial on the Kria KD240. I was greeted by nothing but a blank screen:
This blank screen greeted me both when I tried launching Vitis from Vivado and straight from the command line in a terminal window in Ubuntu (I am using Ubuntu 22.04 LTS).
Unfortunately, since the 2023.2 release of Vitis is so recent at the moment, I couldn't find much help on the AMD (Xilinx) forums aside from the guidance to delete the cache directory for Vitis, ~/.Xilinx/Vitis
. But that solution was in response to a forum post about Vitis 2022.1 not launching properly.
Since this solution of just deleting the cache directory ~/.Xilinx/Vitis
did not resolve my issue in Vitis 2023.2 like it had for the user in the forum post that was using Vitis 2022.1, that lead me to believe the issue was a VS Code issue. So I switched my Google search to see if there were any solutions for VS Code launching into nothing but a blank screen.
This led me to an FAQ page on Microsoft's website for VS Code of common issues and the corresponding solutions. Under the section titled VS Code is Blank?, there is a blurb explaining that the Electron shell used by Visual Studio Code has issues with hardware acceleration for some GPUs. The suggested fix is to disable the option in the Electron shell for GPU acceleration when launching VS Code.
Disable GPU Acceleration in VS CodeThe regular method for disabling GPU acceleration in VS Code directly is to add the Electron --disable-gpu
command-line switch when launching VS Code:
~$ code --disable-gpu
I wasn't sure if the options for Electron had been pulled up through Vitis, so I tried launching Vitis the same way:
~$ vitis --disable-gpu
But --disable-gpu
wasn't recognized as a valid input for Vitis, so I started digging through the installation directory to find where Vitis launches VS Code under the hood.
I found the launch.json file for the Electron shell and opened it with gedit:
~$ sudo gedit /tools/Xilinx/Vitis/2023.2/ide/electron-app/lnx64/resources/app/node_modules/@vscode/ripgrep/.vscode/launch.json
Then based on the guidance in this Stack Overflow post for how to pass arguments in launch.json for VS code, I added the --disable-gpu
argument to the launch of VS Code under the hood of Vitis:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Postinstall",
"program": "${workspaceFolder}/lib/postinstall.js",
"runtimeVersion": "10.12.0",
"args": ["--disable-gpu"]
}
]
}
While I was initially dismayed at the fact that Vitis still launched into nothing but a blank screen after I saved and closed launch.json, I remembered the FAQ also mentioned that deleting the GPU cache for VS Code may be necessary. Since I didn't want to take the time to dig for the GPU cache of the VS Code in Vitis specifically, I just deleted the whole Vitis cache directory (thanks to that AMD forum post I originally found):
~$ rm -rf ~/.Xilinx/Vitis
Then I rebooted my whole system for good measure before testing both methods of launching Vitis again (from Vivado and directly from the Ubuntu command line).
In Vivado: Tools -> Launch Vitis IDE
or
~$ source /tools/Xilinx/Vitis/2023.2/settings64.sh
~$ vitis
And success!
Given that I haven't seen anyone else run into this issue yet with Vitis 2023.2 combined with how common it seems to be in the VS Code community, I figured this was worth it's own dedicated write-up. Happy coding!
Comments
Please log in or sign up to comment.