import torch first to load dll correctly

when custom_rasterizer_kernel is imported before torch under cu128/python 3.12, the following error will raise:

ImportError: DLL load failed while importing custom_rasterizer_kernel: 找不到指定的模块。 

simply swapping these two imports will solve this issue
This commit is contained in:
Yu Wang 2025-03-30 16:24:10 +08:00 committed by GitHub
parent 48dae15e4a
commit 977213426f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,8 +22,8 @@
# fine-tuning enabling code and other elements of the foregoing made publicly available
# by Tencent in accordance with TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT.
import custom_rasterizer_kernel
import torch
import custom_rasterizer_kernel
def rasterize(pos, tri, resolution, clamp_depth=torch.zeros(0), use_depth_prior=0):