Source: blender Version: 4.0.2+dfsg-1 Severity: important Tags: FTBFS, patch User: debian-ri...@lists.debian.org Usertags: riscv64 X-Debbugs-Cc: debian-ri...@lists.debian.org
Dear llvmlite Maintainer, The blender compile failed on riscv64 caused by losing precision when cast from ‘void*’ to ‘CUdeviceptr’.The crucial buildd log below: ``` /<<PKGBUILDDIR>>/intern/cycles/device/cuda/device_impl.cpp:528:25: error: cast from ‘void*’ to ‘CUdeviceptr’ {aka ‘unsigned int’} loses precision [-fpermissive] 528 | cuda_assert(cuMemFree((CUdeviceptr)device_pointer)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /<<PKGBUILDDIR>>/intern/cycles/device/../device/cuda/util.h:32:25: note: in definition of macro ‘cuda_device_assert’ 32 | CUresult result = stmt; \ | ^~~~ /<<PKGBUILDDIR>>/intern/cycles/device/cuda/device_impl.cpp:528:3: note: in expansion of macro ‘cuda_assert’ 528 | cuda_assert(cuMemFree((CUdeviceptr)device_pointer)); | ^~~~~~~~~~~ /<<PKGBUILDDIR>>/intern/cycles/device/cuda/device_impl.cpp: In member function ‘virtual void ccl::CUDADevice::copy_host_to_device(void*, void*, size_t)’: /<<PKGBUILDDIR>>/intern/cycles/device/cuda/device_impl.cpp:558:28: error: cast from ‘void*’ to ‘CUdeviceptr’ {aka ‘unsigned int’} loses precision [-fpermissive] 558 | cuda_assert(cuMemcpyHtoD((CUdeviceptr)device_pointer, host_pointer, size)); ``` The full buildd log is here: https://buildd.debian.org/status/fetch.php?pkg=blender&arch=riscv64&ver=4.0.2%2Bdfsg-1&stamp=1704028470&raw=0 My solution to this issue: Convert the problematic conversion code to a uintptr_t intermediate type.I have tested this modification in local ,and it works well.Please let me know wheather this patch can be accepted. The patch is in the attachment. Gui-Yue Best Regards