diff --git a/.clang-tidy b/.clang-tidy index 8ed34ebb0f..39e6d96b87 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -71,6 +71,19 @@ # -modernize-type-traits # -performance-avoid-endl # +# TODO Code Quality WORKAROUND ROCm 6.2 +# -readability-container-size-empty +# -bugprone-inc-dec-in-conditions +# -readability-avoid-nested-conditional-operator +# -performance-enum-size +# -readability-redundant-member-init +# -bugprone-multi-level-implicit-pointer-conversion +# -clang-analyzer-optin.core.EnumCastOutOfRange +# -cppcoreguidelines-macro-to-enum +# -cppcoreguidelines-owning-memory +# -readability-avoid-return-with-void-value +# -bugprone-unused-local-non-trivial-variable +# Checks: >- *, -abseil-*, @@ -78,9 +91,12 @@ Checks: >- -android-cloexec-fopen, -bugprone-easily-swappable-parameters, -bugprone-exception-escape, + -bugprone-inc-dec-in-conditions, -bugprone-lambda-function-name, -bugprone-macro-parentheses, + -bugprone-multi-level-implicit-pointer-conversion, -bugprone-narrowing-conversions, + -bugprone-unused-local-non-trivial-variable, -bugprone-use-after-move, -cert-env33-c, -cert-err33-c, @@ -90,6 +106,7 @@ Checks: >- -cert-msc51-cpp, -clang-analyzer-alpha.core.CastToStruct, -clang-analyzer-cplusplus.NewDeleteLeaks, + -clang-analyzer-optin.core.EnumCastOutOfRange, -clang-analyzer-optin.performance.Padding, -clang-diagnostic-extern-c-compat, -clang-diagnostic-unused-command-line-argument, @@ -100,11 +117,13 @@ Checks: >- -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-explicit-virtual-functions, -cppcoreguidelines-init-variables, + -cppcoreguidelines-macro-to-enum, -cppcoreguidelines-macro-usage, -cppcoreguidelines-misleading-capture-default-by-value, -cppcoreguidelines-missing-std-forward, -cppcoreguidelines-narrowing-conversions, -cppcoreguidelines-non-private-member-variables-in-classes, + -cppcoreguidelines-owning-memory, -cppcoreguidelines-prefer-member-initializer, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, @@ -168,11 +187,15 @@ Checks: >- -modernize-concat-nested-namespaces, -modernize-unary-static-assert, -performance-avoid-endl, + -performance-enum-size, + -readability-avoid-nested-conditional-operator, -performance-no-automatic-move, -performance-unnecessary-copy-initialization, -performance-unnecessary-value-param, + -readability-avoid-return-with-void-value, -readability-avoid-unconditional-preprocessor-if, -readability-container-data-pointer, + -readability-container-size-empty, -readability-convert-member-functions-to-static, -readability-else-after-return, -readability-function-cognitive-complexity, @@ -182,6 +205,7 @@ Checks: >- -readability-named-parameter, -readability-qualified-auto, -readability-redundant-declaration, + -readability-redundant-member-init, -readability-redundant-string-init, -readability-simplify-boolean-expr, -readability-suspicious-call-argument, diff --git a/CMakeLists.txt b/CMakeLists.txt index 98201516ad..21f96a0d77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,7 @@ if(MIOPEN_STRIP_SYMBOLS AND NOT WIN32 AND NOT APPLE) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") endif() -rocm_setup_version(VERSION 3.2.0) +rocm_setup_version(VERSION 3.3.0) list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ) include(TargetFlags) diff --git a/Dockerfile b/Dockerfile index 89c8065f48..fb272596aa 100755 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ RUN dpkg --add-architecture i386 # Install preliminary dependencies RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \ - "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" \ apt-utils \ ca-certificates \ curl \ @@ -15,17 +14,21 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \ gnupg2 \ wget +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \ + "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" + #Add gpg keys ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn RUN curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm-keyring.gpg -RUN wget https://repo.radeon.com/amdgpu-install/6.1/ubuntu/jammy/amdgpu-install_6.1.60100-1_all.deb --no-check-certificate +RUN wget https://repo.radeon.com/amdgpu-install/6.2/ubuntu/jammy/amdgpu-install_6.2.60200-1_all.deb --no-check-certificate RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \ - ./amdgpu-install_6.1.60100-1_all.deb + ./amdgpu-install_6.2.60200-1_all.deb # Add rocm repository -RUN export ROCM_APT_VER=6.1;\ +RUN export ROCM_APT_VER=6.2;\ echo $ROCM_APT_VER &&\ sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/amdgpu/$ROCM_APT_VER/ubuntu jammy main > /etc/apt/sources.list.d/amdgpu.list' &&\ sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/rocm/apt/$ROCM_APT_VER jammy main > /etc/apt/sources.list.d/rocm.list' @@ -85,6 +88,7 @@ ADD dev-requirements.txt /dev-requirements.txt # Install dependencies # TODO: Add --std=c++14 ARG GPU_ARCH=";" +# install to /opt/rocm will cause permission issue ARG PREFIX=/usr/local ARG USE_FIN="OFF" ARG CCACHE_SECONDARY_STORAGE="" @@ -101,9 +105,12 @@ RUN ccache -s # purge existing composable kernel installed with ROCm # hence cannot use autoremove since it will remove more components +# even purge will remove some other components which is not ideal RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get purge -y --allow-unauthenticated \ - composablekernel-dev + composablekernel-dev \ + miopen-hip + ARG COMPILER_LAUNCHER="" # rbuild is used to trigger build of requirements.txt, dev-requirements.txt RUN if [ "$USE_FIN" = "ON" ]; then \ @@ -120,4 +127,7 @@ RUN pip3 install -r /doc-requirements.txt # Composable Kernel requires this version cmake RUN pip3 install --upgrade cmake==3.27.5 +# groupadd can add one group a time RUN groupadd -f render +RUN groupadd -f video +RUN usermod -a -G render,video root \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index a54735e8c6..6d85a6f7d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -201,9 +201,9 @@ def getDockerImage(Map conf=[:]) { env.DOCKER_BUILDKIT=1 def prefixpath = conf.get("prefixpath", "/opt/rocm") // one image for each prefix 1: /usr/local 2:/opt/rocm - def gpu_arch = "gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102" // prebuilt dockers should have all the architectures enabled so one image can be used for all stages + def gpu_arch = "gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200" // prebuilt dockers should have all the architectures enabled so one image can be used for all stages def mlir_build = conf.get("mlir_build", "ON") // always ON - def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg GPU_ARCH='${gpu_arch}' --build-arg USE_MLIR='${mlir_build}' " + def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg GPU_TARGETS='${gpu_arch}' --build-arg USE_MLIR='${mlir_build}' " if(env.CCACHE_HOST) { def check_host = sh(script:"""(printf "PING\r\n";) | nc -N ${env.CCACHE_HOST} 6379 """, returnStdout: true).trim() @@ -291,7 +291,7 @@ def buildHipClangJob(Map conf=[:]){ } withDockerContainer(image: image, args: dockerOpts + ' -v=/var/jenkins/:/var/jenkins') { - timeout(time: 210, unit:'MINUTES') + timeout(time: 300, unit:'MINUTES') { if (lfs_pull) { sh "git lfs pull --exclude=" @@ -655,7 +655,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot(make_targets: Smoke_targets) + buildHipClangJobAndReboot(make_targets: Smoke_targets, build_install: "true") } } stage('Fp32 Hip Debug gfx90a') { @@ -668,7 +668,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets) + buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, build_install: "true") } } stage('Fp32 Hip Debug gfx908') { @@ -681,7 +681,7 @@ pipeline { } agent{ label rocmnode("gfx908") } steps{ - buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets) + buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, build_install: "true") } } stage('Fp32 Hip Debug gfx94X') { @@ -694,7 +694,7 @@ pipeline { } agent{ label rocmnode("gfx94X") } steps{ - buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, needs_reboot:false) + buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, needs_reboot:false, build_install: "true") } } } @@ -718,7 +718,7 @@ pipeline { NOCOMGR_build_cmd = "CTEST_PARALLEL_LEVEL=4 MIOPEN_LOG_LEVEL=5 make -j\$(nproc) check" } steps{ - buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOCOMGR_flags, build_cmd: NOCOMGR_build_cmd, test_flags: ' --verbose ') + buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOCOMGR_flags, build_cmd: NOCOMGR_build_cmd, test_flags: ' --verbose ', build_install: "true") } } stage('Fp32 Hip Debug NOMLIR gfx90a') { @@ -735,7 +735,7 @@ pipeline { NOMLIR_build_cmd = "CTEST_PARALLEL_LEVEL=4 MIOPEN_LOG_LEVEL=5 make -j\$(nproc) check" } steps{ - buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOMLIR_flags, build_cmd: NOMLIR_build_cmd, test_flags: ' --verbose ') + buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOMLIR_flags, build_cmd: NOMLIR_build_cmd, test_flags: ' --verbose ', build_install: "true") } } stage('Fp32 Hip Debug NOCK gfx90a Build-Only') { @@ -748,7 +748,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot( build_type: 'debug', setup_flags: "-DMIOPEN_USE_COMPOSABLEKERNEL=Off", make_targets: "") + buildHipClangJobAndReboot( build_type: 'debug', setup_flags: "-DMIOPEN_USE_COMPOSABLEKERNEL=Off", make_targets: "", build_install: "true") } } stage('Fp32 Hip Debug Embedded Vega20') { @@ -764,7 +764,7 @@ pipeline { Embedded_flags = "-DMIOPEN_EMBED_DB='gfx906_60'" } steps{ - buildHipClangJobAndReboot( build_type: 'debug', setup_flags: Embedded_flags, build_env: extra_log_env, test_flags: ' --verbose ') + buildHipClangJobAndReboot( build_type: 'debug', setup_flags: Embedded_flags, build_env: extra_log_env, test_flags: ' --verbose ', build_install: "true") } } stage('Fp32 Hip Static gfx90a') { @@ -777,7 +777,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot( setup_flags: "-DBUILD_SHARED_LIBS=Off", mlir_build: 'OFF') + buildHipClangJobAndReboot( setup_flags: "-DBUILD_SHARED_LIBS=Off", mlir_build: 'OFF', build_install: "true") } } stage('Fp32 Hip Normal-Find gfx90a') { @@ -794,7 +794,7 @@ pipeline { execute_cmd = "bin/test_conv2d --disable-verification-cache" } steps{ - buildHipClangJobAndReboot(make_targets: make_targets, execute_cmd: execute_cmd, find_mode: "Normal") + buildHipClangJobAndReboot(make_targets: make_targets, execute_cmd: execute_cmd, find_mode: "Normal", build_install: "true") } } stage('Fp32 Hip Fast-Find gfx90a') { @@ -811,7 +811,7 @@ pipeline { execute_cmd = "MIOPEN_FIND_MODE=2 CTEST_PARALLEL_LEVEL=4 bin/test_conv2d --disable-verification-cache" } steps{ - buildHipClangJobAndReboot( make_targets: make_targets, execute_cmd: execute_cmd) + buildHipClangJobAndReboot( make_targets: make_targets, execute_cmd: execute_cmd, build_install: "true") } } stage('Fp32 Hip gfx90a') { @@ -837,7 +837,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot(make_targets: Smoke_targets, setup_flags: "-DMIOPEN_USE_SQLITE_PERF_DB=On") + buildHipClangJobAndReboot(make_targets: Smoke_targets, setup_flags: "-DMIOPEN_USE_SQLITE_PERF_DB=On", build_install: "true") } } } @@ -857,7 +857,7 @@ pipeline { } agent{ label rocmnode("vega20") } steps{ - buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Bf16 Hip Vega20') { @@ -870,7 +870,7 @@ pipeline { } agent{ label rocmnode("vega20") } steps{ - buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Fp16 Hip gfx908') { @@ -883,7 +883,7 @@ pipeline { } agent{ label rocmnode("gfx908") } steps{ - buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Bf16 Hip gfx908') { @@ -896,7 +896,7 @@ pipeline { } agent{ label rocmnode("gfx908") } steps{ - buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Fp16 Hip gfx90a') { @@ -909,7 +909,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Bf16 Hip gfx90a') { @@ -922,7 +922,7 @@ pipeline { } agent{ label rocmnode("gfx90a") } steps{ - buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets) + buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true") } } stage('Fp16 Hip gfx94X') { @@ -935,7 +935,7 @@ pipeline { } agent{ label rocmnode("gfx94X") } steps{ - buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, needs_reboot:false) + buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, needs_reboot:false, build_install: "true") } } stage('Bf16 Hip gfx94X') { @@ -948,7 +948,7 @@ pipeline { } agent{ label rocmnode("gfx94X") } steps{ - buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, needs_reboot:false) + buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, needs_reboot:false, build_install: "true") } } } diff --git a/src/comgr.cpp b/src/comgr.cpp index aa53b71bb5..b508bced2f 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -701,6 +701,7 @@ void BuildAsm(const std::string& name, #define WORKAROUND_ISSUE_HIPRTC_HIPRTC_HEADER_H 1 // See SWDEV-307838, issue #1648. #define WORKAROUND_ISSUE_1674 (HIP_PACKAGE_VERSION_FLAT >= 5003022305ULL) +#define WORKAROUND_ISSUE_3188 (HIP_PACKAGE_VERSION_FLAT >= 6002041133ULL) // See WORKAROUND_SWDEV_413293 in ./CmakeLists.txt #define WORKAROUND_SWDEV_413293 MIOPEN_HIP_COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK @@ -975,6 +976,9 @@ void BuildHip(const std::string& name, #endif #if WORKAROUND_ISSUE_1674 opts.push_back("-Wno-gnu-line-marker"); +#endif +#if WORKAROUND_ISSUE_3188 + opts.push_back("-Wno-pass-failed"); #endif opts.push_back("-Wno-cuda-compat"); opts.push_back("-fno-gpu-rdc");