gl_vk_chopper example unknown platform error

From the above link I have downloaded the example, Trying to build on jetsonTX2 but getting unknown platform error.

make -j6
Scanning dependencies of target shared_sources
[  4%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/OpenGLText/OpenGLText.cpp.o
[  4%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/traceDisplay/tracedisplayogl.cpp.o
[  6%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/GLSLProgram.cpp.o
[  8%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/WindowProfiler.cpp.o
[ 10%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/nv_dds.cpp.o
[ 13%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers/profiler.cpp.o
In file included from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/platform.h:26:0,
                 from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/main.h:31,
                 from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/GLSLProgram.cpp:16:
/home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/NvFoundation.h:186:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^
In file included from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/platform.h:26:0,
                 from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/main.h:31,
                 from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/WindowProfiler.hpp:31,
                 from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/WindowProfiler.cpp:26:
/home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/NvFoundation.h:186:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/OpenGLText.cpp:182:6: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     "};
      ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/OpenGLText.cpp:197:6: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     "};
      ^
In file included from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/OpenGLText.cpp:72:0:
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/tga.h: In member function ‘TGA::TGAError TGA::load(const char*)’:
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/tga.h:177:40: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fread( &type, sizeof (char), 3, s );   // Read in colormap info and image t
                                        ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/OpenGLText/tga.h:179:40: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fread( &info, sizeof (char), 6, s );
                                        ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/traceDisplay/tracedisplayogl.cpp: In function ‘GLuint LinkGLSLProgram(GLuint, GLuint)’:
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/traceDisplay/tracedisplayogl.cpp:53:42: warning: format not a string literal and no format arguments [-Wformat-security]
 #   define  LOGE(...)  printf(__VA_ARGS__)
                                          ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/traceDisplay/tracedisplayogl.cpp:797:9: note: in expansion of macro ‘LOGE’
         LOGE(infoLog);
         ^
[ 15%] Building CXX object shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/programmanager.cpp.o
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/GLSLProgram.cpp:19:37: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 char* GLSLProgram::incPaths[] = {"/"};
                                     ^
shared_sources/CMakeFiles/shared_sources.dir/build.make:182: recipe for target 'shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/GLSLProgram.cpp.o' failed
make[2]: *** [shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/GLSLProgram.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp:190:0:
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.h:116:5: warning: ‘typedef’ was ignored in this declaration
     };
     ^
In file included from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/platform.h:26:0,
                 from /home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/main.h:31,
                 from /home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/programmanager.cpp:37:
/home/nvidia/vulkan_nv/gl_vk_chopper/../shared_sources/NvFoundation.h:186:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp: In member function ‘bool nv_dds::CDDSImage::load(std::__cxx11::string, bool)’:
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp:335:30: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fread(filecode, 1, 4, fp);
                              ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp:346:44: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fread(&ddsh, sizeof(DDS_HEADER), 1, fp);
                                            ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp:456:35: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
         fread(pixels, 1, size, fp);
                                   ^
/home/nvidia/vulkan_nv/shared_sources/nv_helpers_gl/nv_dds.cpp:489:39: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
             fread(pixels, 1, size, fp);
                                       ^
shared_sources/CMakeFiles/shared_sources.dir/build.make:158: recipe for target 'shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/WindowProfiler.cpp.o' failed
make[2]: *** [shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/WindowProfiler.cpp.o] Error 1
shared_sources/CMakeFiles/shared_sources.dir/build.make:206: recipe for target 'shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/programmanager.cpp.o' failed
make[2]: *** [shared_sources/CMakeFiles/shared_sources.dir/nv_helpers_gl/programmanager.cpp.o] Error 1
CMakeFiles/Makefile2:122: recipe for target 'shared_sources/CMakeFiles/shared_sources.dir/all' failed
make[1]: *** [shared_sources/CMakeFiles/shared_sources.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Hi,

Based on the error, it looks like that this sample doesn’t support aarch64 platform.

We are checking this issue internally.
Will update information with you later.

Thanks.

I just get it working on JetsonTX2…

ARM support is there in the NvFoundation.h file but still was getting that error.

I don’t know if my solution is proper or not, I have add the following lines in the NvFoundation.h file to get it working

#define _M_ARM
#define __arm__

After adding these lines I am able to build the code but got another error of libAntTweakBar.so.
This library file is generated for x64 or may be x86 architecture so I compiled the source code for TX2 and replace it with generated lib files.
I think NVIDIA DesignWorks Samples:https://github.com/nvpro-samples are only made for windows or linux PC.

Hi,

Root cause is that AARCH64 doesn’t be mentioned in the NvFoundation.h.

After applying a change to this file, there are also some tricks required:
1. Compile AntTweakBar locally and replace libAntTweakBar.so in shared_external/AntTweakBar/lib at master · nvpro-samples/shared_external · GitHub
2. Install vulkan header files from GitHub - KhronosGroup/Vulkan-LoaderAndValidationLayers: **Deprecated repository** for Vulkan loader and validation layers to /usr/include/vulkan

We will get the the change for NvFoundation.h merged and will find somewhere to list the installation instruction for ARM.
Thanks for your feedback.

As I told you in my earlier post, I did compile AntTweakBar for the TX2 and also have added the vulkan header files… that is why I am able to build chopper example. And also I tried all nvpro-samples, but not able to build some of the examples.

Hi,

We have fixed the chopper sample.
If you also find other samples cannot build on Jetson, could you share the the sample name with us?

Thanks.

hello sir,
Thank you…
From where I can download that example?

these are the examples I am able to compile successfully:
gl_commandlist_basic
gl_commandlist_bk3d_models
gl_dynamic_lod
gl_simple_FBO
gl_ssao
gl_vk_bk3dthreaded
gl_vk_chopper

Hi,

We commit a fix here: https://github.com/nvpro-samples/shared_sources/pull/12
It should be merged after reviewing and the unknown platform error will not occur again.

Thanks.

Hello Sir,
What about the other examples?
As I mentioned in my previous comment, I am able to compile certain examples only…

Hi,

We will feedback this issue to our internal team.
Could you share the example blocking you currently?

Thanks.

Hello,

These are the examples I am not able to compile:
gl_cadscene_rendertechniques
gl_cl_interop_pingpong_st
gl_cuda_interop_pingpong_st
gl_multicast
gl_occlusion_culling
gl_optix_composite
gl_vk_supersampled
gl_vk_threaded_cadscene

Hi,

As you said, nvpro_sample is designed for x86-based environment.
Some workaround should be implemented before executing on Jetson.

We have verified the nvpro_sample status (identical as yours) and some error we need to check:
Ex. missing header, not declared function or unknown CMake command…

We are co-working with our internal team.
Will update information if we have further progress.

Thanks.

Hi,

We are aware that there are some issue of the public repository and are working on the changes.
Will let you know once we finished.

Thanks.