[Libre-soc-dev] Loading Vulkan Driver

vivek pandya vivekvpandya at gmail.com
Tue Aug 25 16:04:22 BST 2020


I have pushed code to the new branch
https://gitlab.freedesktop.org/vivekvpandya/mesa/-/tree/libresoc_dev
previously it was on master so it will cause me problems working on master
branch.

Also note slight change in meson configure command
meson -Dbuildtype=debug -Dprefix=/home/vivek/install
-Dvulkan-drivers=libre-soc ..

instead of libresoc it is libre-soc for vulkan-drivers option.



On Tue, Aug 25, 2020 at 6:49 PM vivek pandya <vivekvpandya at gmail.com> wrote:

> Finally with help vulkan-loader code I am able to fix the problem with my
> driver code.
>
> The issue was that as of Vulkan API version 1.0.0 there are certain
> functions like
> CreateDevice(), DestroyDevice(), CreateInstance() etc.. are required to be
> exported by ICD .so file. I was missing a few of them.
> Now with that fixed I believe the initial skeleton is in good shape.
>
> Now it fails after
>  77 VkResult
>  78 libresoc_EnumeratePhysicalDevices(VkInstance _instance,
>  79                               uint32_t *pPhysicalDeviceCount,
>  80                               VkPhysicalDevice *pPhysicalDevices)
>  81 {
>  82         if (getenv("LIBRESOC_TRACE")) {
>  83                 fprintf(stderr, "EnumeratePhysicalDevices called\n");
>  84         }
>  85    /* FIXME: stub */
>  86    return VK_SUCCESS;
>  87 }
>
> I think it is logical as it is not returning any actual physical device
> through pointer.
>
>
>
> On Tue, Aug 25, 2020 at 6:15 PM vivek pandya <vivekvpandya at gmail.com>
> wrote:
>
>>
>>
>> On Tue, Aug 25, 2020 at 2:57 AM Luke Kenneth Casson Leighton <
>> lkcl at lkcl.net> wrote:
>>
>>>
>>>
>>> On Monday, August 24, 2020, Jacob Lifshay <programmerjake at gmail.com>
>>> wrote:
>>>
>>>> On Mon, Aug 24, 2020, 02:58 vivek pandya <vivekvpandya at gmail.com>
>>>> wrote:
>>>>
>>>> >
>>>> >
>>>> > On Mon, Aug 24, 2020 at 3:26 PM apinheiro <apinheiro at igalia.com>
>>>> wrote:
>>>> >
>>>> >> After that, our objective was trying to get a really basic Vulkan
>>>> tests
>>>> >> working. As mentioned, we started with a real basic test that just
>>>> did a
>>>> >> clear, as in that way, we didn't need to bother with the compiler
>>>> yet. We
>>>> >> didn't save that test though. In any case, it was really simple, so
>>>> it
>>>> >> should be easy to recreate.
>>>> >>
>>>> > Okay I will write a very simple test.
>>>> >
>>>>
>>>> If your looking for a simple test that just repeatedly clears the
>>>> screen to
>>>> different colors and displays it, check out the /test/testvulkan.c test
>>>> in
>>>> libSDL that I originally wrote. It doesn't use any shaders.
>>>>
>>>> https://www.libsdl.org/download-2.0.php
>>>
>>>
>>> vivek i have asked cole to create a wiki page to track things like this,
>>> also a tutorial how to build the code.
>>>
>>> https://libre-soc.org/3d_gpu/mesa/?updated
>>>
>>> then more people can follow what you are doing, easily set up the build
>>> environment and help comment.
>>>
>> Sure I will add details about how to build the code, I use basically
>> meson and ninja commands,
>> My build directory located in mesa source here is my meson command to
>> configure (I know this does more work than require please add more options
>> if you find useful):
>> meson -Dbuildtype=debug -Dprefix=/home/vivek/install
>> -Dvulkan-drivers=libresoc ..
>>
>> and then
>>
>> ninja
>>
>> ninja install.
>>
>> I also have script to set few environment variables like
>>
>> export
>> VK_ICD_FILENAMES=/home/vivek/install/share/vulkan/icd.d/libresoc_icd.x86_64.json
>> export VK_LOADER_DEBUG=warn
>> export LIBRESOC_TRACE=1
>>
>> I am doing some experiments with extension and entrypoint generation
>> code, so those files will change.
>> I would request not to waste time on current code I have pushed.
>>
>> To test the code I am sing simple tests built by
>> https://github.com/GameTechDev/IntroductionToVulkan
>>
>> I am also using debug build for vulkan loader if any one interested in
>> that please look at
>> https://github.com/KhronosGroup/Vulkan-Loader/blob/master/BUILD.md
>>
>> Thanks,
>> Vivek
>>
>>>
>>> l.
>>>
>>>
>>>
>>> --
>>> ---
>>> crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
>>>
>>>


More information about the Libre-soc-dev mailing list