You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Handle CMAKE_CUDA_ARCHITECTURES/CMAKE_HIP_ARCHITECTURES gracefully, allowing library CMakeLists.txt to provide a sane library default if not user-specified
3
4
#
@@ -69,15 +70,15 @@ endfunction()
69
70
# Set the CMAKE_CUDA_ARCHITECTURES/CMAKE_HIP_ARCHITECTURES value to the environment/cache provided value, or generate a CUDA/HIP version-appropriate default value for a library (i.e all-major or equivalent)
70
71
#
71
72
# For CUDA:
72
-
# If the ENV{CUDAARCHS}, or CMAKE_CUDA_ARCHITECTURES cache variable did not specify a value before the CUDA language was enabled, use build an version-appropriate default for a llibrary, based on the CMake and NVCC version.
73
+
# If the ENV{CUDAARCHS}, or CMAKE_CUDA_ARCHITECTURES cache variable did not specify a value before the CUDA language was enabled, use a CUDA version-appropriate default for a llibrary, based on the CMake and NVCC version.
73
74
# Effectively all-major (-real for all major architectures, and PTX for the most recent)
74
75
#
75
76
# If the user provided a value, it will be validated against nvcc --help unless NO_VALIDATE_ARCHITECTURES is set, or was set in a previous call to flamegpu_init_gpu_architectures without a PROJECT.
76
77
#
77
-
# For HIP:
78
-
# Todo: figure this out
79
-
# Todo: what is the sensible default for HIP?
80
-
# Todo: what bout hip but with PLATFORM=nvidia? should re-use the cuda bits somehow.
78
+
# For HIP (with CMAKE_HIP_PLATFORM=amd):
79
+
# If CMAKE_HIP_ARCHITECTURES cache variable did not specify a value before the HIP language was enabled, use a HIP version-appropriate default for a library, based on the CMake and HIP compiler verisions
80
+
# This should effectively be the equivalent to all-major
81
+
# Todo: what about hip but with PLATFORM=nvidia? should re-use the cuda bits somehow.
81
82
#
82
83
# CUDA or HIP must be enabled as a language prior to this method being called.
83
84
# Todo: This will be a problem for project-name injection that is also CUDA/HIP compatible. Might have to remove that option...
message(AUTHOR_WARNING"Todo: implement flamegpu_set_gpu_architectures for HIP")
211
+
# I cannot find a good, way to programatically get a list of (major) device architectrues for a given version of rocm.
212
+
# rocm_agent_enumerator --all only lists architectures in this machine
213
+
# amdclang --target=amdgcn-amd-amdhsa --print-supported-cpus lists all possible gpu architectures for this version of clang, including those not officially supported by this rocm release
214
+
# and there are 53 listed for rocm 7.2 (amdclang --target=amdgcn-amd-amdhsa --print-supported-cpus |& grep gfx | sort | uniq | wc -l ))
215
+
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html for 7.2.1 included 9 supported architectures gfx1201;gfx1200;gfx1101;gfx1100;gfx1030;gfx950;gfx942;gfx90a;gfx908
216
+
# The ROCm on Radeon and Ryzen docs (https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityryz/native_linux/native_linux_compatibility.html) include some additioanl architectrues, but seems to be very partial support.
217
+
# Generic architectures are the closest thing to building for SM_50 and it running on 52. I.e. gfx10-1-generic, but this might not be available for all supported families (https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/code-portability.html#generic-code-objects)
218
+
# As this is so hard to detect, we probably just leave default as to use the native build and document this? Then for any redistributable CI either list everything, or use the -generic architectures (whcich could be extracted via --target=amdgcn-amd-amdhsa --print-supported-cpus)?
219
+
message(AUTHOR_WARNING"Todo: implement flamegpu_set_gpu_architectures for HIP. This is non trivial.")
0 commit comments