[?2004l [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ make clean [?2004l rm -f devices memory [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ make [?2004l gcc -ggdb -O0 -std=c99 -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include devices.c -o devices -lvulkan -lglib-2.0 devices.c: In function ‘dump_devices’: devices.c:35:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 35 | for (int i = 0; i < mem_prop.memoryHeapCount; ++i) { | ^ devices.c:41:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 41 | for (int i = 0; i < mem_prop.memoryTypeCount; i++) | ^ devices.c:49:5: warning: format not a string literal and no format arguments []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security-Wformat-security]8;;] 49 | printf(buf->str); | ^~~~~~ devices.c: In function ‘main’: devices.c:79:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 79 | for (int i = 0; i < count; i++) { | ^ devices.c:83:17: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 83 | fprintf("failed to create VK instance (%d)\n", (int) res); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * In file included from devices.c:11: /usr/include/stdio.h:350:38: note: expected ‘FILE * restrict’ but argument is of type ‘char *’ 350 | extern int fprintf (FILE *__restrict __stream, | ~~~~~~~~~~~~~~~~~^~~~~~~~ devices.c:83:56: warning: passing argument 2 of ‘fprintf’ makes pointer from integer without a cast []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion]8;;] 83 | fprintf("failed to create VK instance (%d)\n", (int) res); | ^~~~~~~~~ | | | int In file included from devices.c:11: /usr/include/stdio.h:351:44: note: expected ‘const char * restrict’ but argument is of type ‘int’ 351 | const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ devices.c:83:9: warning: format not a string literal and no format arguments []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security-Wformat-security]8;;] 83 | fprintf("failed to create VK instance (%d)\n", (int) res); | ^~~~~~~ devices.c:52:15: warning: unused parameter ‘c’ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-parameter-Wunused-parameter]8;;] 52 | int main (int c, char *argv[]) | ~~~~^ devices.c:52:24: warning: unused parameter ‘argv’ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-parameter-Wunused-parameter]8;;] 52 | int main (int c, char *argv[]) | ~~~~~~^~~~~~ gcc -ggdb -O0 -std=c99 -Wall -Wextra -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include memory.c -o memory -lvulkan -lglib-2.0 memory.c: In function ‘map_and_test_memory’: memory.c:68:18: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int’ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 68 | if (*ptr != i) { | ^~ memory.c:69:29: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat=-Wformat=]8;;] 69 | fprintf(stderr, "%s: didn't get expect value %"PRIx32" != %"PRIx32" @ %p\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | __func__, *ptr, i, ptr); | ~~~~ | | | uint64_t {aka long unsigned int} In file included from memory.c:5: /usr/include/inttypes.h:120:26: note: format string is defined here 120 | # define PRIx32 "x" memory.c:16:63: warning: unused parameter ‘mem_props’ []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-parameter-Wunused-parameter]8;;] 16 | VkPhysicalDeviceMemoryProperties mem_props, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ memory.c: In function ‘main’: memory.c:111:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 111 | if (device_index >= count || device_index < 0) { | ^~ memory.c:123:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare]8;;] 123 | for (int i = 0; i < count; i++) { | ^ [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ sudo ./devices [?2004l I have counted 3 vulkan devices Device Info: Device Name: AMD Radeon RX 6400 (RADV NAVI24) Device Type: Discrete GPU Memory: Heap 0: size 4026531840 (Device local) Heap 1: size 16682303488 (Unknown) Heap 2: size 268435456 (Device local) Memory 0 is from heap 0 with flags 0x1 Memory 1 is from heap 0 with flags 0x1 Memory 2 is from heap 1 with flags 0x6 Memory 3 is from heap 2 with flags 0x7 Memory 4 is from heap 2 with flags 0x7 Memory 5 is from heap 1 with flags 0xe Memory 6 is from heap 1 with flags 0xe Memory 7 is from heap 0 with flags 0xc1 Memory 8 is from heap 1 with flags 0xc6 Memory 9 is from heap 2 with flags 0xc7 Memory 10 is from heap 1 with flags 0xce Device Info: Device Name: llvmpipe (LLVM 15.0.7, 256 bits) Device Type: CPU Memory: Heap 0: size 2147483648 (Device local) Memory 0 is from heap 0 with flags 0xf Device Info: Device Name: Intel(R) UHD Graphics 630 (CML GT2) Device Type: Integrated GPU Memory: Heap 0: size 25023458304 (Device local) Memory 0 is from heap 0 with flags 0xf [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ sudo ./memory 0 [?2004l queue 0/0: flags 0x0 queue 1/0: flags 0x0 Testing memory type 0 Failed to map memory: -5 Error mapping and testing memory type 0 Testing memory type 1 Failed to map memory: -5 Error mapping and testing memory type 1 Testing memory type 2 mapped memory to 0x7fb3ae788000 read mapped memory wrote to mapped memory finished checking memory Testing memory type 3 mapped memory to 0x7fb3ae788000 unzerroed memory @ 0x7fb3ae788000 skipping 0 check for rest of map (size=1024) read mapped memory wrote to mapped memory finished checking memory Testing memory type 4 mapped memory to 0x7fb3ae788000 unzerroed memory @ 0x7fb3ae788008 skipping 0 check for rest of map (size=1024) read mapped memory wrote to mapped memory finished checking memory Testing memory type 5 mapped memory to 0x7fb3ae788000 read mapped memory wrote to mapped memory finished checking memory Testing memory type 6 mapped memory to 0x7fb3ae788000 read mapped memory wrote to mapped memory finished checking memory Testing memory type 7 Failed to map memory: -5 Error mapping and testing memory type 7 Testing memory type 8 mapped memory to 0x7fb3ae788000 read mapped memory wrote to mapped memory finished checking memory Testing memory type 9 mapped memory to 0x7fb3ae788000 unzerroed memory @ 0x7fb3ae788008 skipping 0 check for rest of map (size=1024) read mapped memory wrote to mapped memory finished checking memory Testing memory type 10 mapped memory to 0x7fb3ae788000 read mapped memory wrote to mapped memory finished checking memory [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ sudo mem./memory 1 [?2004l queue 0/0: flags 0x0 Testing memory type 0 mapped memory to 0x5643784c1000 unzerroed memory @ 0x5643784c1028 skipping 0 check for rest of map (size=1024) read mapped memory wrote to mapped memory finished checking memory [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$ sudo ./memory 2 [?2004l queue 0/0: flags 0x0 Testing memory type 0 mapped memory to 0x7f76c77a8000 read mapped memory wrote to mapped memory finished checking memory [?2004hbill@rocky:~/w/exp/vulkan/vulkan-baremetal-tests$