Provide a Makefile for Linux Intel x86_64 + Intel GPU + SDL and Vulkan #2480

Closed
opened 2019-04-07 19:21:09 +00:00 by ebachard · 8 comments
ebachard commented 2019-04-07 19:21:09 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: Dear ImGui 1.70WIP (16990)
define:_cpluplus=201103
define:linux
define: GNUC=7
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK

Remark : the makefile works for any version containing the sdlvulkan implementation in fact

Branch: master

Back-end/Renderer/Compiler/OS Vulkan / g++ / Linux Intel x86_64

Back-ends: SDL2 + Vulkan (1.1)
=> see attached vulkaninfo.txt

Compiler: g++-7
Operating System: Linux Intel x86_64 kernel 4.15.22 (custom)

My Issue/Question:

Not an issue : I just propose a Makefile for Linux user who want to give a try to the sdl_vulkan imgui implementation, on Intel machine, for Intel GPU only

Screenshots/Video

Not really needed : we see the demo window, but i can attach one on demand.

Do what you want with this Makefile (MIT license).
HTH

**Version/Branch of Dear ImGui:** Version: Dear ImGui 1.70WIP (16990) define:_cpluplus=201103 define:__linux__ define: __GNUC__=7 define: IMGUI_HAS_VIEWPORT define: IMGUI_HAS_DOCK Remark : the makefile works for any version containing the sdlvulkan implementation in fact Branch: master **Back-end/Renderer/Compiler/OS** Vulkan / g++ / Linux Intel x86_64 Back-ends: SDL2 + Vulkan (1.1) => see attached vulkaninfo.txt Compiler: g++-7 Operating System: Linux Intel x86_64 kernel 4.15.22 (custom) **My Issue/Question:** Not an issue : I just propose a Makefile for Linux user who want to give a try to the sdl_vulkan imgui implementation, on Intel machine, for Intel GPU only **Screenshots/Video** Not really needed : we see the demo window, but i can attach one on demand. Do what you want with this Makefile (MIT license). HTH
ebachard commented 2019-04-07 19:23:46 +00:00 (Migrated from github.com)

More information about Vulkan + attached the Makefile as Makefile.txt (just rename it).

Makefile.txt
vulkaninfo_Linux_Intel_g++.txt

More information about Vulkan + attached the Makefile as Makefile.txt (just rename it). [Makefile.txt](https://github.com/ocornut/imgui/files/3051969/Makefile.txt) [vulkaninfo_Linux_Intel_g++.txt](https://github.com/ocornut/imgui/files/3051970/vulkaninfo_Linux_Intel_g%2B%2B.txt)
ocornut commented 2019-04-07 19:35:18 +00:00 (Migrated from github.com)

(Repost as e-mail answer seemed to damage the formatting)

Hello,

If you are going to submit a Makefile please have been modelled against the existing Makefiles, and use Pull Request instead of issue + attachment.

I also don’t imagine that there isn’t a way to link Vulkan librairies that isn’t tied to a specific GPU to be used at runtime. If you believe this is the case please justify it with references because this seems rather dubious :(

Some ref:
https://vulkan.lunarg.com/doc/view/1.1.85.0/linux/getting_started.html

Thanks.

(Repost as e-mail answer seemed to damage the formatting) Hello, If you are going to submit a Makefile please have been modelled against the existing Makefiles, and use Pull Request instead of issue + attachment. I also don’t imagine that there isn’t a way to link Vulkan librairies that isn’t tied to a specific GPU to be used at runtime. If you believe this is the case please justify it with references because this seems rather dubious :( Some ref: https://vulkan.lunarg.com/doc/view/1.1.85.0/linux/getting_started.html Thanks.
ebachard commented 2019-04-07 19:59:07 +00:00 (Migrated from github.com)

Hi,

Sorry, for the wrong model, I didn't thought there was one for Makefiles in Dear ImGui (people can test the one I provided waiting).

About the linking : I hope I got what you mean, but with Intel GPU, you'll need to install libvulkan_intel and on AMD machine, libvulkan_radeon. For example, on my machine, I'm building mesa from git (got 19.1.0 devel installled) and only libvulkan_intel is needed. The pre-build .deb is mesa-vulkan-drivers containing both. That's why I took care to be precise with the GPU type.

In fact, this is the beginning for vulkan on Linux (I mean : working well), but there is to my knowledge, no working Vulkan driver for NVidia cards on Linux (see https://www.phoronix.com/scan.php?page=article&item=nouveau-nvidia-eoy2018&num=1 ). I was myself surprised to see it working so well (looks promising though)

FYI, other link : https://wiki.archlinux.org/index.php/Vulkan (only Intel and amd seems to be available)

Hi, Sorry, for the wrong model, I didn't thought there was one for Makefiles in Dear ImGui (people can test the one I provided waiting). About the linking : I hope I got what you mean, but with Intel GPU, you'll need to install libvulkan_intel and on AMD machine, libvulkan_radeon. For example, on my machine, I'm building mesa from git (got 19.1.0 devel installled) and only libvulkan_intel is needed. The pre-build .deb is mesa-vulkan-drivers containing both. That's why I took care to be precise with the GPU type. In fact, this is the beginning for vulkan on Linux (I mean : working well), but there is to my knowledge, no working Vulkan driver for NVidia cards on Linux (see https://www.phoronix.com/scan.php?page=article&item=nouveau-nvidia-eoy2018&num=1 ). I was myself surprised to see it working so well (looks promising though) FYI, other link : https://wiki.archlinux.org/index.php/Vulkan (only Intel and amd seems to be available)
djdeath commented 2019-04-07 20:06:01 +00:00 (Migrated from github.com)

I don't think you're supposed to link against a particular driver.
You should link against the Vulkan loader which then loads the installed drivers.

The options needed for compilation should be reported by pkg-config --cflags --libs vulkan

I don't think you're supposed to link against a particular driver. You should link against the Vulkan loader which then loads the installed drivers. The options needed for compilation should be reported by `pkg-config --cflags --libs vulkan`
ebachard commented 2019-04-07 20:07:50 +00:00 (Migrated from github.com)

Ahh, well, I completely missed the information. Thanks a lot, I'll test it !

Ahh, well, I _completely_ missed the information. Thanks a lot, I'll test it !
ebachard commented 2019-04-07 20:10:38 +00:00 (Migrated from github.com)

Ok it works. Nice to see such issue avoided (indeed it was unclean)

@djdeath : thans a lot ! I'll go to bed less stupid :-)

Ok it works. Nice to see such issue avoided (indeed it was unclean) @djdeath : thans a lot ! I'll go to bed less stupid :-)
ebachard commented 2019-04-07 20:16:10 +00:00 (Migrated from github.com)

I forgot : I had to shut up two warnings (but maybe they are Linux only).

  • one about unused variable (not important imho)
  • one about comparison between signed and unsigned int:
In file included from ./../../imgui.h:63:0,
                 from ./main.cpp:4:
./main.cpp: In function ‘void SetupVulkan(const char**, uint32_t)’:
./main.cpp:125:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         IM_ASSERT(g_QueueFamily != -1);
                   ~~~~~~~~~~~~~~^~~~~
./main.cpp:125:9: note: in expansion of macro ‘IM_ASSERT’
         IM_ASSERT(g_QueueFamily != -1);
         ^~~~~~~~~

See the diff below for the hacks.

diff --git a/examples/example_sdl_vulkan/main.cpp b/examples/example_sdl_vulkan/main.cpp
index a7404ec..998654f 100644
--- a/examples/example_sdl_vulkan/main.cpp
+++ b/examples/example_sdl_vulkan/main.cpp
@@ -21,7 +21,9 @@ static VkPhysicalDevice             g_PhysicalDevice = VK_NULL_HANDLE;
 static VkDevice                     g_Device = VK_NULL_HANDLE;
 static uint32_t                     g_QueueFamily = (uint32_t)-1;
 static VkQueue                      g_Queue = VK_NULL_HANDLE;
+#ifdef _DEBUG
 static VkDebugReportCallbackEXT     g_DebugReport = VK_NULL_HANDLE;
+#endif
 static VkPipelineCache              g_PipelineCache = VK_NULL_HANDLE;
 static VkDescriptorPool             g_DescriptorPool = VK_NULL_HANDLE;
 
@@ -122,7 +124,7 @@ static void SetupVulkan(const char** extensions, uint32_t extensions_count)
                 break;
             }
         free(queues);
-        IM_ASSERT(g_QueueFamily != -1);
+        IM_ASSERT((int)g_QueueFamily != -1);
     }
 
     // Create Logical Device (with 1 queue)

I forgot : I had to shut up two warnings (but maybe they are Linux only). - one about unused variable (not important imho) - one about comparison between signed and unsigned int: ```` In file included from ./../../imgui.h:63:0, from ./main.cpp:4: ./main.cpp: In function ‘void SetupVulkan(const char**, uint32_t)’: ./main.cpp:125:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] IM_ASSERT(g_QueueFamily != -1); ~~~~~~~~~~~~~~^~~~~ ./main.cpp:125:9: note: in expansion of macro ‘IM_ASSERT’ IM_ASSERT(g_QueueFamily != -1); ^~~~~~~~~ ```` See the diff below for the hacks. ```` diff --git a/examples/example_sdl_vulkan/main.cpp b/examples/example_sdl_vulkan/main.cpp index a7404ec..998654f 100644 --- a/examples/example_sdl_vulkan/main.cpp +++ b/examples/example_sdl_vulkan/main.cpp @@ -21,7 +21,9 @@ static VkPhysicalDevice g_PhysicalDevice = VK_NULL_HANDLE; static VkDevice g_Device = VK_NULL_HANDLE; static uint32_t g_QueueFamily = (uint32_t)-1; static VkQueue g_Queue = VK_NULL_HANDLE; +#ifdef _DEBUG static VkDebugReportCallbackEXT g_DebugReport = VK_NULL_HANDLE; +#endif static VkPipelineCache g_PipelineCache = VK_NULL_HANDLE; static VkDescriptorPool g_DescriptorPool = VK_NULL_HANDLE; @@ -122,7 +124,7 @@ static void SetupVulkan(const char** extensions, uint32_t extensions_count) break; } free(queues); - IM_ASSERT(g_QueueFamily != -1); + IM_ASSERT((int)g_QueueFamily != -1); } // Create Logical Device (with 1 queue) ````
ocornut commented 2019-04-07 21:03:25 +00:00 (Migrated from github.com)

I have pushed fixes for the two warnings above, thanks.

I have pushed fixes for the two warnings above, thanks.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#2480
No description provided.