<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/148615>148615</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Offload] Unit tests fail with "Plugin was not initialized!" assertion in `deinit`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
leandrolcampos
</td>
</tr>
</table>
<pre>
When I try to run the `kernel.unittest` test:
```bash
> ninja -C build/runtimes/runtimes-bins OffloadUnitTests
> ./build/runtimes/runtimes-bins/offload/unittests/OffloadAPI/kernel.unittests
```
I get this error message at the end of the test log:
```bash
kernel.unittests: /home/leandro/llvm-project/offload/plugins-nextgen/common/src/PluginInterface.cpp:1658: Error llvm::omp::target::plugin::GenericPluginTy::deinit(): Assertion `Initialized && "Plugin was not initialized!"' failed.
pure virtual method called
terminate called without an active exception
Aborted (core dumped)
```
The same happens for other tests, like `device.unittests` and `memory.unittests`.
**Environment:**
* Device: CUDA_NVIDIA_GeForce_RTX_4070_Laptop_GPU
* LLVM version: Custom build from git
* LLVM Project Commit Hash: `2886d30dd68f798deda7093d00bf9fc52dabcdd7`
* Operating System: Ubuntu 24.04.2 LTS (WSL2)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMlFGPnDYQxz-N92V0K2MWWB54oLchXenanJq7pG8rgwdwAjayh71cP31l4JJLT1UrWWKwPX_PjH8e6b3uDGLBkl9YctrJmXrrigGlUc4OjRwn63e1Vc_F5x4NnIHcM5AFNxugHoGl_Cs6g8N-NpoIPbGUw_KNS8aXkfJ11NL34T9-B0abLxJubqGe9aCYqNxsSI_oX5k3tTYePrTtYKV6NJoe0JPfBPZMVP_ly0RlV28mqpfwwuymWd6fmaj-Eb5_HfGawBk6JKBee0DnrIMRvZcdgqSlBmgU2HYxgwIMtvvX5N-cFpfARNXbEZmotroHa7iON5OzX7Chn_KYhrnTxt8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