* update blender to 17:4.2.3-3

This commit is contained in:
Alexander Baldeck 2024-11-17 15:38:13 +01:00
parent 353c83e5f7
commit 3fa4fbec7f
4 changed files with 230 additions and 28 deletions

View File

@ -1,7 +1,7 @@
pkgbase = blender
pkgdesc = A fully integrated 3D graphics creation suite
pkgver = 4.1.1
pkgrel = 9.1
pkgver = 4.2.3
pkgrel = 3
epoch = 17
url = https://www.blender.org
arch = x86_64
@ -87,20 +87,16 @@ pkgbase = blender
depends = zstd
optdepends = libdecor: wayland support
options = !lto
source = git+https://projects.blender.org/blender/blender.git#tag=v4.1.1
source = git+https://projects.blender.org/blender/blender-addons.git#tag=v4.1.1
source = git+https://projects.blender.org/blender/blender-addons-contrib#tag=v4.1.1
source = git+https://projects.blender.org/blender/blender-assets#tag=v4.1.1
source = git+https://projects.blender.org/blender/blender.git#tag=v4.2.3
source = git+https://projects.blender.org/blender/blender-assets#tag=v4.2.3
source = https://developer.download.nvidia.com/redist/optix/v8.0/OptiX-8.0-Include.zip
source = force-draco1.patch
source = force-draco2.patch
source = blender-4.11-mantaflow-python-3.12.patch
source = ffmpeg-7-1.patch
source = ffmpeg-7-2.patch
sha512sums = 194274ee62c2a3b96e81af92520d424fb7bda24902cffcf2cd9a2e343c0627fe74cdd08d52709c8f181df72f7e36fc64f6144412c459f5a5a0b4497babd2fe07
sha512sums = 4476c93942e5efc5a8ee7c4ef1caea2e77dc6e40eb825e35c0120f7e9f714ff8bdb873bb83d47ac27f8616eedac8e52f15804ed603c093044490f89e626baa80
sha512sums = 877ed9ced417c5879b0bc6a7d3d87aa68a3e4015df9c08945c468dfab59a513bdd03523b7593e556fc9d0e22dbad25d980238e25583ea34a77ffcae3693cd0e7
sha512sums = 2eaa05da22d4a304d1db310bd8c04358e70fdd927cbaadd574e179a86bf288c7b4fa1188d15f1928788ce9c5d2b15b512d47743a230e703f44c07cb7bbc39c5b
sha512sums = 777365523ef08862b723dcbd9ceb9716a69b7af387694209caafdb68f97fd5eb2ccb48702dc3188ea2719f3c45416337ceb829e52e267f5d8d84bb6314b0fd9e
sha512sums = 1e47ca5a824a5d830e95f424ad1c2d066571bd038badfacbb4001632742c1777f62a81e79612a787d5ab0038d2712730b9372bcec44bcac6131734c4430e40b3
sha512sums = 5502d9df847de12badc702c0444bd4f1f7620460b2235026df2c3133da1e04c148af0f1fc7f345e9a0c009c32f905f66c8d427743445e8864d3a797cdce6a483
sha512sums = e239da4f3906f1b54265435181cf770bae3d269c8d915df9a73861e6ee71ec70bf2339426e7c81a91e5a567273b3b3742d7a99feefd3398d821b26e1ff3a56d0
sha512sums = c162646eba42ea7112cfb615466c2cbaddac8d254d4a9e91cf887c5bffef1325a983701163223a1fdee091310ac5574a400347aab7f52321825b5fa3d5a9036f

4
blender/.nvchecker.toml Normal file
View File

@ -0,0 +1,4 @@
[blender]
source = "git"
git = "https://projects.blender.org/blender/blender-assets"
prefix = "v"

View File

@ -9,8 +9,8 @@
# fine with them.
pkgname=blender
pkgver=4.1.1
pkgrel=9.1
pkgver=4.2.3
pkgrel=3
epoch=17
pkgdesc="A fully integrated 3D graphics creation suite"
arch=(x86_64 powerpc64le)
@ -73,7 +73,6 @@ depends=(
'openvdb'
'openxr'
'potrace'
# 'ptex'
'pugixml'
'pystring'
'python'
@ -125,8 +124,6 @@ optdepends_x86_64=(
# We're using !lto here as otherwise we get stuff such as FS#77557
options=('!lto')
source=("git+https://projects.blender.org/blender/blender.git#tag=v$pkgver"
"git+https://projects.blender.org/blender/blender-addons.git#tag=v$pkgver"
"git+https://projects.blender.org/blender/blender-addons-contrib#tag=v$pkgver"
"git+https://projects.blender.org/blender/blender-assets#tag=v$pkgver"
https://developer.download.nvidia.com/redist/optix/v8.0/OptiX-8.0-Include.zip
force-draco1.patch
@ -134,10 +131,8 @@ source=("git+https://projects.blender.org/blender/blender.git#tag=v$pkgver"
blender-4.11-mantaflow-python-3.12.patch
ffmpeg-7-1.patch
ffmpeg-7-2.patch)
sha512sums=('194274ee62c2a3b96e81af92520d424fb7bda24902cffcf2cd9a2e343c0627fe74cdd08d52709c8f181df72f7e36fc64f6144412c459f5a5a0b4497babd2fe07'
'4476c93942e5efc5a8ee7c4ef1caea2e77dc6e40eb825e35c0120f7e9f714ff8bdb873bb83d47ac27f8616eedac8e52f15804ed603c093044490f89e626baa80'
'877ed9ced417c5879b0bc6a7d3d87aa68a3e4015df9c08945c468dfab59a513bdd03523b7593e556fc9d0e22dbad25d980238e25583ea34a77ffcae3693cd0e7'
'2eaa05da22d4a304d1db310bd8c04358e70fdd927cbaadd574e179a86bf288c7b4fa1188d15f1928788ce9c5d2b15b512d47743a230e703f44c07cb7bbc39c5b'
sha512sums=('777365523ef08862b723dcbd9ceb9716a69b7af387694209caafdb68f97fd5eb2ccb48702dc3188ea2719f3c45416337ceb829e52e267f5d8d84bb6314b0fd9e'
'1e47ca5a824a5d830e95f424ad1c2d066571bd038badfacbb4001632742c1777f62a81e79612a787d5ab0038d2712730b9372bcec44bcac6131734c4430e40b3'
'5502d9df847de12badc702c0444bd4f1f7620460b2235026df2c3133da1e04c148af0f1fc7f345e9a0c009c32f905f66c8d427743445e8864d3a797cdce6a483'
'e239da4f3906f1b54265435181cf770bae3d269c8d915df9a73861e6ee71ec70bf2339426e7c81a91e5a567273b3b3742d7a99feefd3398d821b26e1ff3a56d0'
'c162646eba42ea7112cfb615466c2cbaddac8d254d4a9e91cf887c5bffef1325a983701163223a1fdee091310ac5574a400347aab7f52321825b5fa3d5a9036f'
@ -147,6 +142,7 @@ sha512sums=('194274ee62c2a3b96e81af92520d424fb7bda24902cffcf2cd9a2e343c0627fe74c
prepare() {
cd "$pkgname"
git submodule init
git config submodule.release/datafiles/assets.url "$srcdir/blender-assets"
git -c protocol.file.allow=always submodule update
@ -157,13 +153,9 @@ prepare() {
git -C release/datafiles/assets lfs fetch network-origin
git -C release/datafiles/assets lfs checkout
# Copy addons to expected location
cp -r "$srcdir"/blender-addons scripts/addons
cp -r "$srcdir"/blender-addons-contrib scripts/addons_contrib
# fix draco
patch -p1 -i "$srcdir"/force-draco1.patch
patch -p1 -d scripts/addons -i "$srcdir"/force-draco2.patch
patch -p1 -d scripts/addons_core -i "$srcdir"/force-draco2.patch
# fix fluid sim domain with python 3.12
# https://gitlab.archlinux.org/archlinux/packaging/packages/blender/-/issues/18
@ -189,8 +181,9 @@ build() {
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D WITH_LINKER_MOLD=ON
-D CUDA_HOST_COMPILER=/usr/bin/gcc
-D HIP_ROOT_DIR=/opt/rocm
# Skip targets gfx115{0,1} as they not supported by ROCm 6.0.2
-D CYCLES_HIP_BINARIES_ARCH="gfx900;gfx90c;gfx902;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103"
-D OCLOC_INSTALL_DIR=/usr
-D OPTIX_ROOT_DIR="$srcdir"
-D PYTHON_VERSION="$(_get_pyver)"
@ -207,6 +200,8 @@ build() {
case "${CARCH}" in
x86_64)
cmake_options+=(
-D CUDA_HOST_COMPILER="$NVCC_CCBIN"
-D SYCL_ROOT_DIR=/opt/intel/oneapi/compiler/latest
-D WITH_CYCLES_OSL=ON
-D WITH_CYCLES=ON
-D WITH_CYCLES_EMBREE=ON
@ -243,9 +238,6 @@ package() {
install -Dm644 release/freedesktop/org.blender.Blender.metainfo.xml "${pkgdir}/usr/share/metainfo/org.blender.Blender.metainfo.xml"
# Manually install additional scripts (See FS#69351)
cp -r scripts/addons_contrib/* "${pkgdir}"/usr/share/blender/4*/scripts/addons_contrib/
# Manually install draco bindings (See FS#73415)
mkdir -p "${pkgdir}/usr/lib/python$(_get_pyver)"/
mv "${pkgdir}"/usr/share/blender/4*/python/lib/* "${pkgdir}"/usr/lib/

View File

@ -0,0 +1,210 @@
From f753cf14fca2b97d4bbf48eccc1defcaa1d17daa Mon Sep 17 00:00:00 2001
From: bsavery <brian.savery@gmail.com>
Date: Wed, 3 Jan 2024 18:16:07 +0100
Subject: [PATCH] Cycles: add ROCm 6 compatibility for HIP
ROCm 6 brings some changes to the HIP API. This pull request is meant to be
backward and forward compatible.
That is Blender could be compiled with either ROCM 6 or 5 and run on either.
The main change is the hipMemoryType enum, which we check based on the
runtime version to use the correct enum values.
Without this, HIP will not work on Windows with upcoming 23.40 driver.
Pull Request: https://projects.blender.org/blender/blender/pulls/116713
---
extern/hipew/include/hipew.h | 26 +++++++++++++++++++-----
extern/hipew/src/hipew.c | 23 +++++++++++++++++++++
intern/cycles/device/hip/device_impl.cpp | 16 +++++++++++----
intern/cycles/device/hip/device_impl.h | 2 ++
4 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/extern/hipew/include/hipew.h b/extern/hipew/include/hipew.h
index f82654ffe93..df7498aaeae 100644
--- a/extern/hipew/include/hipew.h
+++ b/extern/hipew/include/hipew.h
@@ -185,13 +185,26 @@ typedef struct textureReference {
typedef textureReference* hipTexRef;
+/**
+ * ROCm 6 and ROCm 5 memory types are different.
+ * For now, we include both in the enum and then use the get_hip_memory_type
+ * Function to convert. When removing ROCm 5 compatibility this can be simplified.
+*/
typedef enum hipMemoryType {
- hipMemoryTypeHost = 0x00,
- hipMemoryTypeDevice = 0x01,
- hipMemoryTypeArray = 0x02,
- hipMemoryTypeUnified = 0x03,
+ hipMemoryTypeHost_v5 = 0x00,
+ hipMemoryTypeDevice_v5 = 0x01,
+ hipMemoryTypeArray_v5 = 0x02,
+ hipMemoryTypeUnified_v5 = 0x03,
+ hipMemoryTypeUnregistered = 0,
+ hipMemoryTypeHost = 1,
+ hipMemoryTypeDevice = 2,
+ hipMemoryTypeManaged = 3,
+ hipMemoryTypeArray = 10,
+ hipMemoryTypeUnified = 11,
} hipMemoryType;
+hipMemoryType get_hip_memory_type(hipMemoryType mem_type, int runtime_version);
+
/**
* Pointer attributes
*/
@@ -316,7 +329,7 @@ typedef enum hipDeviceAttribute_t {
hipDeviceAttributeConcurrentManagedAccess, ///< Device can coherently access managed memory concurrently with the CPU
hipDeviceAttributeCooperativeLaunch, ///< Support cooperative launch
hipDeviceAttributeCooperativeMultiDeviceLaunch, ///< Support cooperative launch on multiple devices
- hipDeviceAttributeDeviceOverlap, ///< Cuda only. Device can concurrently copy memory and execute a kernel.
+ hipDeviceAttributeDeviceOverlap, ///< Cuda only. Device can concurrently copy memory and execute a kernel.
///< Deprecated. Use instead asyncEngineCount.
hipDeviceAttributeDirectManagedMemAccessFromHost, ///< Host can directly access managed memory on
///< the device without migration
@@ -420,6 +433,7 @@ typedef enum hipDeviceAttribute_t {
///< hipStreamWaitValue64() , '0' otherwise.
hipDeviceAttributeAmdSpecificEnd = 19999,
hipDeviceAttributeVendorSpecificBegin = 20000,
+ hipDeviceAttribute
// Extended attributes for vendors
} hipDeviceAttribute_t;
@@ -1160,6 +1174,7 @@ typedef const char* HIPAPI thipGetErrorString(hipError_t error);
typedef hipError_t HIPAPI thipGetLastError(hipError_t error);
typedef hipError_t HIPAPI thipInit(unsigned int Flags);
typedef hipError_t HIPAPI thipDriverGetVersion(int* driverVersion);
+typedef hipError_t HIPAPI thipRuntimeGetVersion(int* runtimeVersion);
typedef hipError_t HIPAPI thipGetDevice(int* device);
typedef hipError_t HIPAPI thipGetDeviceCount(int* count);
typedef hipError_t HIPAPI thipGetDeviceProperties(hipDeviceProp_t* props, int deviceId);
@@ -1310,6 +1325,7 @@ extern thipGetErrorString* hipGetErrorString;
extern thipGetLastError* hipGetLastError;
extern thipInit *hipInit;
extern thipDriverGetVersion *hipDriverGetVersion;
+extern thipRuntimeGetVersion *hipRuntimeGetVersion;
extern thipGetDevice *hipGetDevice;
extern thipGetDeviceCount *hipGetDeviceCount;
extern thipGetDeviceProperties *hipGetDeviceProperties;
diff --git a/extern/hipew/src/hipew.c b/extern/hipew/src/hipew.c
index 4927f86b804..74b2ef111d6 100644
--- a/extern/hipew/src/hipew.c
+++ b/extern/hipew/src/hipew.c
@@ -35,6 +35,7 @@ thipGetErrorString *hipGetErrorString;
thipGetLastError *hipGetLastError;
thipInit *hipInit;
thipDriverGetVersion *hipDriverGetVersion;
+thipRuntimeGetVersion *hipRuntimeGetVersion;
thipGetDevice *hipGetDevice;
thipGetDeviceCount *hipGetDeviceCount;
thipGetDeviceProperties *hipGetDeviceProperties;
@@ -285,6 +286,7 @@ static int hipewHipInit(void) {
HIP_LIBRARY_FIND_CHECKED(hipGetLastError);
HIP_LIBRARY_FIND_CHECKED(hipInit);
HIP_LIBRARY_FIND_CHECKED(hipDriverGetVersion);
+ HIP_LIBRARY_FIND_CHECKED(hipRuntimeGetVersion);
HIP_LIBRARY_FIND_CHECKED(hipGetDevice);
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceCount);
HIP_LIBRARY_FIND_CHECKED(hipGetDeviceProperties);
@@ -410,7 +412,28 @@ static int hipewHipInit(void) {
return result;
}
+hipMemoryType get_hip_memory_type(hipMemoryType mem_type, int runtime_version) {
+ /** Convert hipMemoryType for backwards compatibility with rocm5/6.
+ * This can be removed when support for ROCm 5 is removed. */
+ /* If version is 5 we need to use the old enum vals (60000000 is start of ROCm 6) */
+ if (runtime_version > 60000000) {
+ return mem_type;
+ }
+
+ switch (mem_type) {
+ case hipMemoryTypeHost:
+ return hipMemoryTypeHost_v5;
+ case hipMemoryTypeDevice:
+ return hipMemoryTypeDevice_v5;
+ case hipMemoryTypeArray:
+ return hipMemoryTypeArray_v5;
+ case hipMemoryTypeUnified:
+ return hipMemoryTypeUnified_v5;
+ default:
+ return hipMemoryTypeUnregistered; /* This should not happen. */
+ }
+}
int hipewInit(hipuint32_t flags) {
int result = HIPEW_SUCCESS;
diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp
index 57d82b07631..9a3f6b95143 100644
--- a/intern/cycles/device/hip/device_impl.cpp
+++ b/intern/cycles/device/hip/device_impl.cpp
@@ -116,6 +116,9 @@ HIPDevice::HIPDevice(const DeviceInfo &info, Stats &stats, Profiler &profiler)
hipDeviceGetAttribute(&minor, hipDeviceAttributeComputeCapabilityMinor, hipDevId);
hipDevArchitecture = major * 100 + minor * 10;
+ /* Get hip runtime Version needed for memory types. */
+ hip_assert(hipRuntimeGetVersion(&hipRuntimeVersion));
+
/* Pop context set by hipCtxCreate. */
hipCtxPopCurrent(NULL);
}
@@ -745,9 +748,9 @@ void HIPDevice::tex_alloc(device_texture &mem)
HIP_MEMCPY3D param;
memset(&param, 0, sizeof(HIP_MEMCPY3D));
- param.dstMemoryType = hipMemoryTypeArray;
+ param.dstMemoryType = get_memory_type(hipMemoryTypeArray);
param.dstArray = array_3d;
- param.srcMemoryType = hipMemoryTypeHost;
+ param.srcMemoryType = get_memory_type(hipMemoryTypeHost);
param.srcHost = mem.host_pointer;
param.srcPitch = src_pitch;
param.WidthInBytes = param.srcPitch;
@@ -777,10 +780,10 @@ void HIPDevice::tex_alloc(device_texture &mem)
hip_Memcpy2D param;
memset(&param, 0, sizeof(param));
- param.dstMemoryType = hipMemoryTypeDevice;
+ param.dstMemoryType = get_memory_type(hipMemoryTypeDevice);
param.dstDevice = mem.device_pointer;
param.dstPitch = dst_pitch;
- param.srcMemoryType = hipMemoryTypeHost;
+ param.srcMemoryType = get_memory_type(hipMemoryTypeHost);
param.srcHost = mem.host_pointer;
param.srcPitch = src_pitch;
param.WidthInBytes = param.srcPitch;
@@ -958,6 +961,11 @@ int HIPDevice::get_device_default_attribute(hipDeviceAttribute_t attribute, int
return value;
}
+hipMemoryType HIPDevice::get_memory_type(hipMemoryType mem_type)
+{
+ return get_hip_memory_type(mem_type, hipRuntimeVersion);
+}
+
CCL_NAMESPACE_END
#endif
diff --git a/intern/cycles/device/hip/device_impl.h b/intern/cycles/device/hip/device_impl.h
index bded023bd4a..fdbec2e3dbf 100644
--- a/intern/cycles/device/hip/device_impl.h
+++ b/intern/cycles/device/hip/device_impl.h
@@ -32,6 +32,7 @@ class HIPDevice : public GPUDevice {
int pitch_alignment;
int hipDevId;
int hipDevArchitecture;
+ int hipRuntimeVersion;
bool first_error;
HIPDeviceKernels kernels;
@@ -102,6 +103,7 @@ class HIPDevice : public GPUDevice {
protected:
bool get_device_attribute(hipDeviceAttribute_t attribute, int *value);
int get_device_default_attribute(hipDeviceAttribute_t attribute, int default_value);
+ hipMemoryType get_memory_type(hipMemoryType mem_type);
};
CCL_NAMESPACE_END