Skip to content

Working Linux install (Fedora 43, RTX 40-series, Python 3.12) #182

Description

@Liatach

Getting Trellis2 GGUF working on Linux (Fedora 43, RTX 40-series)

Posting a complete, working install for Linux + an RTX 40-series (Ada / sm_89) card, plus the
full list of problems hit along the way. The short version: the prebuilt Linux wheels don't
include Ada (sm_89) kernels
, so several native extensions must be rebuilt from source. Once
that's done, the whole image-to-3D pipeline runs.


Part 1 — Clean install instructions

Environment

  • Fedora 43, RTX 4070 Ti (12 GB), Nvidia driver 580 (reports CUDA 13.0)
  • Python 3.12, PyTorch 2.8.0+cu128, CUDA Toolkit 12.8

1. CUDA 12.8 toolkit (independent of the 13.0 driver)

sudo dnf config-manager addrepo --from-repofile=https://developer.download.nvidia.com/compute/cuda/repos/fedora41/x86_64/cuda-fedora41.repo
sudo dnf install cuda-toolkit-12-8
nvcc --version   # should say release 12.8

2. GCC 14 (CUDA 12.8 nvcc does not support Fedora 43's default GCC 15)

sudo dnf install gcc14 gcc14-c++

3. Python 3.12 venv + PyTorch

python3.12 -m venv ~/ai/comfy-env
source ~/ai/comfy-env/bin/activate

# scope CUDA + Ada arch to the venv
cat >> ~/ai/comfy-env/bin/activate << 'EOF'

export CUDA_HOME=/usr/local/cuda-12.8
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
export TORCH_CUDA_ARCH_LIST="8.9"
EOF
source ~/ai/comfy-env/bin/activate

pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0+cu128 --index-url https://download.pytorch.org/whl/cu128

4. Pin torch so later installs can't upgrade it

echo "torch==2.8.0+cu128
torchvision==0.23.0+cu128
torchaudio==2.8.0+cu128" > ~/ai/constraints.txt

mkdir -p ~/ai/comfy-env/pip
cat > ~/ai/comfy-env/pip/pip.ini << 'EOF'
[global]
constraint = /home/<user>/ai/constraints.txt
extra-index-url = https://download.pytorch.org/whl/cu128
EOF

5. ComfyUI + nodes

cd ~/ai
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI && pip install -r requirements.txt
cd custom_nodes
git clone https://github.com/visualbruno/ComfyUI-Trellis2.git
git clone https://github.com/Aero-Ex/ComfyUI-Trellis2-GGUF.git
git clone https://github.com/city96/ComfyUI-GGUF.git
pip install gguf

6. Patch the CUDA math header (glibc 2.41 fix — see Part 2)

Add noexcept (true) to sinpi/sinpif/cospi/cospif/rsqrt/rsqrtf declarations in
/usr/local/cuda-12.8/targets/x86_64-linux/include/crt/math_functions.h. (sed one-liners per
function; back up the file first.)

7. Install prebuilt wheels (the ones that work) with --no-deps

cd ~/ai/ComfyUI/custom_nodes/ComfyUI-Trellis2/wheels/Linux/Torch291
for w in cumesh custom_rasterizer nvdiffrec_render; do
  pip install --force-reinstall --no-deps "$w"*.whl
done
pip install trimesh plyfile easydict zstandard

8. Rebuild the sm_89-sensitive extensions from source

export TORCH_CUDA_ARCH_LIST="8.9"
export CUDAHOSTCXX=/usr/bin/g++-14 CC=/usr/bin/gcc-14 CXX=/usr/bin/g++-14

# flex_gemm
git clone https://github.com/JeffreyXiang/FlexGEMM.git /tmp/FlexGEMM
pip install /tmp/FlexGEMM --no-build-isolation --force-reinstall --no-deps

# o_voxel (from microsoft/TRELLIS.2, recursive for bundled Eigen)
git clone --recursive https://github.com/microsoft/TRELLIS.2.git /tmp/TRELLIS.2
pip install /tmp/TRELLIS.2/o-voxel --no-build-isolation --force-reinstall --no-deps

# nvdiffrast (JIT-compiles at runtime; arch var must be set then too)
git clone -b v0.4.0 https://github.com/NVlabs/nvdiffrast.git /tmp/nvdiffrast
pip install /tmp/nvdiffrast --no-build-isolation --force-reinstall --no-deps

9. Apply the o_voxel tiled-mesh patch (GGUF fork needs it)

cp ~/ai/ComfyUI/custom_nodes/ComfyUI-Trellis2-GGUF/patch/flexible_dual_grid.py \
   ~/ai/comfy-env/lib64/python3.12/site-packages/o_voxel/convert/flexible_dual_grid.py

10. Models

hf download facebook/dinov3-vitl16-pretrain-lvd1689m --local-dir ~/ai/ComfyUI/models/facebook/dinov3-vitl16-pretrain-lvd1689m
hf download microsoft/TRELLIS.2-4B --local-dir ~/ai/ComfyUI/models/trellis2/TRELLIS.2-4B

(DINOv3 is gated — accept access on HF first. GGUF Q4_K_M weights auto-download on first run.)

11. Launch

cd ~/ai/ComfyUI
PYTORCH_ALLOC_CONF=expandable_segments:True python main.py --listen 127.0.0.1

Recommended settings for 12 GB

  • Loader: GGUF Q4_K_M, flash_attn, low_vram=true
  • Generator: pipeline_type=512 (not 1024_cascade), use_tiled_decoder=true
  • Post-process: dual_contouring_resolution=512, texture_size=2048

Part 2 — Problems encountered and workarounds

1. undefined symbol: ...SymBool...guard_or_false... on import.
The prebuilt wheels need a newer PyTorch ABI than 2.7.0 exposes. Fix: use torch 2.8.0 (not 2.7.0).

2. CUDA version mismatch when pip builds wheels from source (detected 12.8 mismatches compiled 13.0).
The cu128 torch wheels report internal CUDA 13.0. When pip tries to build cumesh/flex_gemm from
source it fails. Fix: install all wheels with --no-deps so pip never rebuilds them.

3. cp312 wheels but wrong Python. The Linux wheels are cp312 — the venv must be Python 3.12,
not 3.13+.

4. torch keeps silently upgrading to 2.12.0 (CPU), re-breaking everything with
operator torchvision::nms does not exist. Installing misc deps pulls a newer torch.
Fix: pin torch in a constraints file referenced from pip.ini (Part 1 step 4).

5. flash_attn ABI mismatch. Need the wheel matching torch's _GLIBCXX_USE_CXX11_ABI.
Check with python -c "import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)" — was True here,
so use the cxx11abiTRUE flash-attn wheel (2.8.3, cu12, torch2.8, cp312), installed with --no-deps.

6. CUDA error: no kernel image is available at runtime (the big one).
torch's arch list is sm_70/75/80/86/90/100/120 — no sm_89. Ada cards have no compatible kernel
in the prebuilt extensions. Fix: rebuild flex_gemm, o_voxel, and nvdiffrast from source with
TORCH_CUDA_ARCH_LIST="8.9".

7. Source builds fail with 98 errors in hash.cu. Fedora 43's GCC 15 is too new for CUDA 12.8.
Fix: install GCC 14 and point nvcc at it with CUDAHOSTCXX=/usr/bin/g++-14.

8. After GCC 14, ~6 errors remain: exception specification is incompatible for cospi/sinpi/rsqrt.
This is the glibc 2.41 vs CUDA conflict (new noexcept specifiers). Fix: patch CUDA's
crt/math_functions.h to add noexcept (true) to those six declarations.

9. ImportError: cannot import name 'tiled_flexible_dual_grid_to_mesh'.
Microsoft's upstream o-voxel doesn't have the tiled function the GGUF fork calls (the import is at
module top, so toggling use_tiled_decoder off doesn't help). Fix: copy the GGUF fork's
patch/flexible_dual_grid.py over the installed o_voxel file. The tiled function is pure-Python
chunking over existing kernels — no recompile needed.

10. OOM on 12 GB at the shape decoder / remesh. 1024_cascade and 1024 dual-contouring exceed
12 GB. Fix: pipeline_type=512, dual_contouring_resolution=512, texture_size=2048, low_vram=true,
and launch with PYTORCH_ALLOC_CONF=expandable_segments:True.

11. nvdiffrast RasterizeGLContext still calls the CUDA rasterizer internally, so swapping
CUDA→GL context in nodes.py does NOT avoid the sm_89 kernel. Fix: rebuild nvdiffrast from source
(it JIT-compiles at runtime, so TORCH_CUDA_ARCH_LIST=8.9 must also be set in the runtime env,
not just at build).

12. UNRESOLVED — texture baking produces rainbow/scrambled output.
Geometry generates correctly end-to-end, but the baked texture is rainbow noise. Not yet diagnosed.
Suspects: linear-vs-sRGB color-space mismatch in the bake; bake_on_vertices/use_custom_normals
settings; reorient_vertices desyncing UVs vs attributes; or ComfyUI's Preview3D misreporting color
space (check the .glb in Blender or an external glTF viewer before assuming the bake is wrong).
If anyone has solved Ada/Linux texture baking on this stack, please comment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions