Skip to content

Commit

Permalink
use custom linker script hip_fatbin_insert
Browse files Browse the repository at this point in the history
This works around having too many gfx targets which otherwise fails linking.
  • Loading branch information
jeffdaily committed Mar 7, 2024
1 parent 8a101fe commit 67ee991
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/hip_fatbin_insert
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SECTIONS {
.hipFatBinSegment : { *(.hipFatBinSegment) }
} INSERT AFTER .bss

SECTIONS {
.hip_fatbin : { *(.hip_fatbin) }
} INSERT AFTER .hipFatBinSegment
1 change: 1 addition & 0 deletions cmake/onnxruntime_providers_rocm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
auto_set_source_files_hip_language(${onnxruntime_providers_rocm_src})
onnxruntime_add_shared_library_module(onnxruntime_providers_rocm ${onnxruntime_providers_rocm_src})
target_compile_options(onnxruntime_providers_rocm PRIVATE -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1)
target_link_options(onnxruntime_providers_rocm PRIVATE -T ${REPO_ROOT}/cmake/hip_fatbin_insert)

if(NOT MSVC)
target_compile_options(onnxruntime_providers_rocm PRIVATE -Wno-sign-compare)
Expand Down

0 comments on commit 67ee991

Please sign in to comment.