Skip to content

Commit

Permalink
Update macOS Vulkan SDK instructions (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMayes committed Apr 2, 2024
1 parent 813685f commit 822a29b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tutorial/book/src/development_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,22 @@ If you receive an error message then ensure that your drivers are up-to-date, in

### macOS

These instructions will assume you are using the [Homebrew package manager](https://brew.sh/). Also, keep in mind that you will need at least MacOS version 10.11, and your device needs to support the [Metal API](https://en.wikipedia.org/wiki/Metal_(API)#Supported_GPUs).

The SDK can be downloaded from the [LunarG website](https://vulkan.lunarg.com/) using the buttons at the bottom of the page. You don't have to create an account, but it will give you access to some additional documentation that may be useful to you.

![](./images/vulkan_sdk_download_buttons.png)

The SDK version for MacOS internally uses [MoltenVK](https://moltengl.com/). There is no native support for Vulkan on MacOS, so what MoltenVK does is actually act as a layer that translates Vulkan API calls to Apple's Metal graphics framework. With this you can take advantage of debugging and performance benefits of Apple's Metal framework.
The SDK version for MacOS internally uses [MoltenVK](https://moltengl.com/). There is no native support for Vulkan on MacOS, so what MoltenVK does is act as a layer that translates Vulkan API calls to Apple's Metal graphics framework. With this you can take advantage of debugging and performance benefits of Apple's Metal framework.

After downloading it, simply extract the contents to a folder of your choice. Inside the extracted folder, in the `Applications` folder you should have some executable files that will run a few demos using the SDK. Run the `vkcube` executable and you will see the following:

![](./images/cube_demo_mac.png)

#### Setup Environment

When running a Vulkan application outside of the Vulkan SDK directory, you will likely also need to run the `setup-env.sh` script from the Vulkan SDK to avoid errors about the inability to find Vulkan libraries (e.g., `libvulkan.dylib`). If you installed the Vulkan SDK in the default location, this script should be located in a path like this: `~/VulkanSDK/1.3.280.1/setup-env.sh` (replace the version number to match your Vulkan SDK installation).

You can also add this script to be executed by default by adding it to your shell's setup script. For example you could add a statement like this to `~/.zshrc`:

```
source ~/VulkanSDK/1.3.280.1/setup-env.sh
```
2 changes: 2 additions & 0 deletions tutorial/book/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This page lists solutions to common problems that you may encounter while developing Vulkan applications.

* **_(macOS)_ I installed the Vulkan SDK, but I get an error about `libvulkan.dylib` not being found when I run a Vulkan application** - see the [`Setup Environment` section of the Vulkan SDK setup instructions for macOS](./development_environment.md#setup-environment)

* **I get an access violation error in the core validation layer** – Make sure that MSI Afterburner / RivaTuner Statistics Server is not running, because it has some compatibility problems with Vulkan.

* **I don't see any messages from the validation layers / Validation layers are not available** – First make sure that the validation layers get a chance to print errors by keeping the terminal open after your program exits. You can do this from Visual Studio by running your program with Ctrl-F5 instead of F5, and on Linux by executing your program from a terminal window. If there are still no messages and you are sure that validation layers are turned on, then you should ensure that your Vulkan SDK is correctly installed by following the "Verify the Installation" instructions [on this page](https://vulkan.lunarg.com/doc/view/1.2.135.0/windows/getting_started.html). Also ensure that your SDK version is at least 1.1.106.0 to support the `VK_LAYER_KHRONOS_validation` layer.
Expand Down

0 comments on commit 822a29b

Please sign in to comment.