Sign in to follow this  

Vulkan Vulkan: how to compile SaschaWillems demos on ubuntu 16.04.10?

Recommended Posts

Posted (edited)

Did you add `ppa:canonical-x/vulkan` to your apt repositories?

 

Yes. Heres it all:


user@user-Lenovo-IdeaPad-Flex-10:~$ sudo apt-add-repository ppa:canonical-x/vulkan
[sudo] password for user:
 UPDATE 2016-11-19
All packages have been purged, this PPA was meant for packaging testing only and it has served it's purpose.

UPDATE 2016-03-18 -- vulkan loader has dropped it's demos (can't ship prebuilt shaders) and vkcube is broken, but the driver is now fixed and Willems demos work (some might crash though)

-----

This ppa contains bits and pieces needed to test Vulkan BUT ONLY FOR XENIAL (and maybe 14.04 in the future).

:: sudo apt-add-repository ppa:canonical-x/vulkan
:: sudo apt update
:: sudo apt install vulkan-utils mesa-vulkan-drivers

now run 'vulkaninfo'

Shinier demos: https://github.com/SaschaWillems/Vulkan
Clone the repository, then download the binary tarball and extract it in the bin/ directory of the repository, and run binaries from there (chmod first). Some are buggy with the current intel driver on this PPA.

NOTE:
The intel driver needs DRI3, so either enable it via xorg.conf, or remove intel_drv.so and use the modesetting driver instead (will still be hw accelerated).

Have questions? #ubuntu-x on freenode
 More info: https://launchpad.net/~canonical-x/+archive/ubuntu/vulkan
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp8adk234w/secring.gpg' created
gpg: keyring `/tmp/tmp8adk234w/pubring.gpg' created
gpg: requesting key 12CB614C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp8adk234w/trustdb.gpg: trustdb created
gpg: key 12CB614C: public key "Launchpad PPA for Canonical X.org" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
user@user-Lenovo-IdeaPad-Flex-10:~$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://ppa.launchpad.net/canonical-x/vulkan/ubuntu xenial InRelease
Hit:3 http://gb.archive.ubuntu.com/ubuntu xenial InRelease              
Hit:4 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease      
Hit:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu xenial InRelease
Hit:6 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease    
Reading package lists... Done                      
Building dependency tree       
Reading state information... Done
All packages are up-to-date.
user@user-Lenovo-IdeaPad-Flex-10:~$ sudo apt install vulkan-utils mesa-vulkan-drivers
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mesa-vulkan-drivers
user@user-Lenovo-IdeaPad-Flex-10:~$

It may not be available at the moment? Or they forgot it :)

 

I'm not even sure if vulkan will run on my laptop, it doesn't under windows, hence why I'm on Ubuntu(pretty cool).

Edited by paulgriffiths

Share this post


Link to post
Share on other sites

[tt]
> UPDATE 2016-11-19 All packages have been purged, this PPA was meant for packaging testing only and it has served it's purpose.
[/tt]


I think your answer is right there. :^)

It seems you may need to find some other route. Have you tried any of the official pacakages? Ubuntu’s libvulkan-dev, perhaps?

Share this post


Link to post
Share on other sites
Posted (edited)

 

[tt]
> UPDATE 2016-11-19 All packages have been purged, this PPA was meant for packaging testing only and it has served it's purpose.
[/tt]


I think your answer is right there. :^)

It seems you may need to find some other route. Have you tried any of the official pacakages? Ubuntu’s libvulkan-dev, perhaps?

 

 

Ill try that. Thanks did not know these officials existed.

How do you install them? Am pretty new to Ubuntu.

Edited by paulgriffiths

Share this post


Link to post
Share on other sites
You can use `apt-get install` or `apt install` as sudo to install packages. Enter `man apt` to read more about your system’s package manager. If you aren’t already, I highly recommend you familiarize yourself with text-based terminals for both Linux and Windows.

Share this post


Link to post
Share on other sites
Posted (edited)

The same;

 

 sudo  apt-get install  mesa-vulkan-drivers
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mesa-vulkan-drivers

Edited by paulgriffiths

Share this post


Link to post
Share on other sites
In reply to your first edit, you can check whether or not you’re root with `whoami`— also your prompt will end with `#` if you’re root, or `$` as a regular user.

And you seem to be using the old package name again:

[tt]$ sudo apt-get install libvulkan-dev[/tt]

Share this post


Link to post
Share on other sites
Posted (edited)

In reply to your first edit, you can check whether or not you’re root with `whoami`— also your prompt will end with `#` if you’re root, or `$` as a regular user.

And you seem to be using the old package name again:

[tt]$ sudo apt-get install libvulkan-dev[/tt]

Still the same even with synaptic manager.

 

Thanks for your help. : I'm guessing mesa-vulkan-drivers are not currently available.

Edited by paulgriffiths

Share this post


Link to post
Share on other sites
Posted (edited)

Drop installing packages. There's no such need and it's pretty much obsolete. Vulkan doesn't install anymore system-wide. Go to LunarG website and download the SDK: https://lunarg.com/vulkan-sdk/ It contains all you need and even more and everything is up-to-date. I usually unpack Vulkan SDK into /opt keeping all updated versions and symlinking the latest one as the "current". Since it's not a system-wide package anymore you will need to tell where the Vulkan headers and libraries are however, the lazy way is just creating symlinks in /usr/include and /usr/lib into the proper directories from the SDK. Also, it's necessary to tell where the layers are by defining VK_LAYER_PATH env variable ( for example in .bashrc ) that points into PATH_TO_SDK/x86_64/etc/explicit_layer.d directory/. I have updated LD_LIBRARY_PATH in order to pick up the right runtime library ( points at PATH_TO_SDK/x86_64/lib ). Basically, everything you need is in the x86_64 directory ( which before used to be installed system-wide ). It may sound complicated but you do it only once and then, with each update of the SDK you just link to the new directory. It keeps environment clean, easy to update and doesn't mess up drivers ( which was the case if one used one of those nvidia-prime drivers in the past ). All instructions are in the SDK/config directory. If you follow them, you won't have a problem with setting Vulkan environment up. Then you may run build scripts to build examples, samples and tools.

Edited by j_uk_dev

Share this post


Link to post
Share on other sites
Posted (edited)

Drop installing packages. There's no such need and it's pretty much obsolete. Vulkan doesn't install anymore system-wide. Go to LunarG website and download the SDK: https://lunarg.com/vulkan-sdk/ It contains all you need and even more and everything is up-to-date. I usually unpack Vulkan SDK into /opt keeping all updated versions and symlinking the latest one as the "current". Since it's not a system-wide package anymore you will need to tell where the Vulkan headers and libraries are however, the lazy way is just creating symlinks in /usr/include and /usr/lib into the proper directories from the SDK. Also, it's necessary to tell where the layers are by defining VK_LAYER_PATH env variable ( for example in .bashrc ) that points into PATH_TO_SDK/x86_64/etc/explicit_layer.d directory/. I have updated LD_LIBRARY_PATH in order to pick up the right runtime library ( points at PATH_TO_SDK/x86_64/lib ). Basically, everything you need is in the x86_64 directory ( which before used to be installed system-wide ). It may sound complicated but you do it only once and then, with each update of the SDK you just link to the new directory. It keeps environment clean, easy to update and doesn't mess up drivers ( which was the case if one used one of those nvidia-prime drivers in the past ). All instructions are in the SDK/config directory. If you follow them, you won't have a problem with setting Vulkan environment up. Then you may run build scripts to build examples, samples and tools.

 

 

Thanks for the info, but Ill have to buy a new pc, the deferred shadows demo I'm interested in is glsl 4.5  ive only 4.0.

 

I'm presuming the version numbering for vulkan is the same as opengl's glsl?

Edited by paulgriffiths

Share this post


Link to post
Share on other sites

Drop installing packages. There's no such need and it's pretty much obsolete.

 
I don't think that is very good advice unless you're trying to show how you're a 1337 h4XX0rz.  Tested binary packges have obsoleted the need to download and compile all your software from source on modern distros, not the other way around, and for very good reason.
 
You can pull the latest Mesa 13 packages from the xorg-edgers PPA and the latest Vulkan from the graphics-drivers PPA -- these are PPAs maintained by the people who maintain the official binary packages in Ubuntu and those folks work directly with the various upstreams on bugfixes etc..  Since the software is not fully release-QAd, all the usual disclaimers apply about stability but you can be sure they're clean and not malware.

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libvulkan-dev

That should get you a new enough version of Mesa, OpenGL, GLSL, and Vulkan, at the cost of not having gone through full system integration testing and without full release-level support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      628676
    • Total Posts
      2984174
  • Similar Content

    • By hiya83
      (Posted this in graphics forum too, which was perhaps the wrong forum for it)
      Hey, I was wondering if on mobile development (Android mainly but iOS as well if you know of it), if there is a GPUView equivalent for whole system debugging so we can figure out if the CPU/GPU are being pipelined efficiently, if there are bubbles, etc. Also slightly tangent question, but do mobile GPU's have a DMA engine exposed as a dedicated Transfer Queue for Vulkan?
      Thanks!
    • By hiya83
      Hey, I was wondering if on mobile development (Android mainly but iOS as well if you know of it), if there is a GPUView equivalent for whole system debugging so we can figure out if the CPU/GPU are being pipelined efficiently, if there are bubbles, etc. Also slightly tangent question, but do mobile GPU's have a DMA engine exposed as a dedicated Transfer Queue for Vulkan?
    • By mark_braga
      I am working on a project which needs to share render targets between Vulkan and DirectX12. I have enabled the external memory extension and now allocate the memory for the render targets by adding the VkExportMemoryInfoKHR to the pNext chain of VkMemoryAllocateInfo. Similarly I have added the VkExternalMemoryImageCreateInfo to the pNext chain of VkImageCreateInfo.
      After calling the get win32 handle function, I get some handle pointer which is not null (I assume it is valid).
      VkExternalMemoryImageCreateInfoKHR externalImageInfo = {}; if (gExternalMemoryExtensionKHR) { externalImageInfo.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR; externalImageInfo.pNext = NULL; externalImageInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KH imageCreateInfo.pNext = &externalImageInfo; } vkCreateImage(...); VkExportMemoryAllocateInfoKHR exportInfo = { VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR }; exportInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR; memoryAllocateInfo.pNext = &exportInfo; vkAllocateMemory(...); VkMemoryGetWin32HandleInfoKHR info = { VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, NULL }; info.memory = pTexture->GetMemory(); info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR; VkResult res = vkGetMemoryWin32HandleKHR(vulkanDevice, &info, &pTexture->pSharedHandle); ASSERT(VK_SUCCESS == res); Now when I try to call OpenSharedHandle from a D3D12 device, it crashes inside nvwgf2umx.dll with the integer division by zero error.
      I am now lost and have no idea what the other handle types do.
      For example: How do we get the D3D12 resource from the VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR handle?
      I also found some documentation on this link but it doesn't help much.
      https://javadoc.lwjgl.org/org/lwjgl/vulkan/NVExternalMemoryWin32.html
      This is all assuming the extension works as expected since it has made it to the KHR
    • By dwatt
      I am trying to get vulkan on android working and have run into a big issue. I don't see any validation layers available. I have tried linking their libraries into mine but still no layers. I have tried compiling it into a library of my own but the headers for it are all over the place. Unfortunately , google's examples and tutorials are out of date and don't work for me. Any idea what I have to do to get those layers to work?
    • By mark_braga
      It seems like nobody really knows what is the correct behavior after window minimizes in Vulkan.
      I have looked at most of the examples (Sascha Willems, GPUOpen,...) and all of them crash after the window minimize event with the error VK_ERROR_OUT_OF_DATE either with an assertion during acquire image or after calling present. This is because we have to recreate the swap chain.
      I tried this but then Vulkan expects you to provide a swap chain with extents { 0, 0, 0, 0 }, but now if you try to set the viewport or create new image views with extents { 0, 0, 0, 0 }, Vulkan expects you to provide non-zero values. So now I am confused.
      Should we just do nothing after a window minimize event? No rendering, update, ...?
  • Popular Now