[PR #19] [CLOSED] linux: stop exporting cudaMalloc/cudaFree symbols #66

Closed
opened 2026-10-26 22:24:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/19
Author: @PozzettiAndrea
Created: 3/11/2026
Status: ❌ Closed

Base: master ← Head: master


📝 Commits (1)

  • f6db56f linux: stop exporting cudaMalloc/cudaFree symbols

📊 Changes

1 file changed (+5 additions, -3 deletions)

View changed files

📝 src/plat.h (+5 -3)

📄 Description

Third-party CUDA extensions (e.g. cumesh) that call cudaMalloc are currently being silently redirected to vrambuf virtual memory, causing CUDA error 700 (illegal memory access) when their kernels run.

Here's a little example:

    File "/home/work/trellis2-vb/ComfyUI/execution.py", line 295, in process_inputs                                                                                                   
      result = f(**inputs)                                                                                                                                                            
    File ".../vb_nodes.py", line 1619, in process                                                                                                                                     
      cumesh.init(*CuMesh.remeshing.remesh_narrow_band_dc_quad(                                                                                                                       
    File ".../cumesh_vb/remeshing.py", line 787, in remesh_narrow_band_dc_quad                                                                                                        
      grid_verts = _C.get_sparse_voxel_grid_active_vertices(                                                                                                                          
  RuntimeError: [CuMesh] CUDA error:                                                                                                                                                  
      File:       .../svox2vert.cu                                                                                                                                                    
      Line:       184                                                                                                                                                                 
      Error code: 700                                                                                                                                                                 
      Error text: an illegal memory access was encountered                                                                                                                            

This means a lot of people using nodes with CUDA packages are using --disable-dynamic-vram.

Removing #define aimdo_cuda_malloc cudaMalloc / aimdo_cuda_free cudaFree on Linux fixes this, without affecting DynamicVRAM (alloc_fn/free_fn, cudaMallocAsync/cudaFreeAsync, and VBAR model weight paging are all unchanged)

As far as I understand, VRAM pressure is still detected via cuMemGetInfo polling in budget_deficit()


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-aimdo/pull/19 **Author:** [@PozzettiAndrea](https://github.com/PozzettiAndrea) **Created:** 3/11/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`f6db56f`](https://github.com/Comfy-Org/comfy-aimdo/commit/f6db56f649f7d89f4f535b8d911f1a4c45e17d73) linux: stop exporting cudaMalloc/cudaFree symbols ### 📊 Changes **1 file changed** (+5 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/plat.h` (+5 -3) </details> ### 📄 Description Third-party CUDA extensions (e.g. cumesh) that call cudaMalloc are currently being silently redirected to vrambuf virtual memory, causing CUDA error 700 (illegal memory access) when their kernels run. Here's a little example: ``` File "/home/work/trellis2-vb/ComfyUI/execution.py", line 295, in process_inputs result = f(**inputs) File ".../vb_nodes.py", line 1619, in process cumesh.init(*CuMesh.remeshing.remesh_narrow_band_dc_quad( File ".../cumesh_vb/remeshing.py", line 787, in remesh_narrow_band_dc_quad grid_verts = _C.get_sparse_voxel_grid_active_vertices( RuntimeError: [CuMesh] CUDA error: File: .../svox2vert.cu Line: 184 Error code: 700 Error text: an illegal memory access was encountered ``` This means a lot of people using nodes with CUDA packages are using --disable-dynamic-vram. Removing #define aimdo_cuda_malloc cudaMalloc / aimdo_cuda_free cudaFree on Linux fixes this, without affecting DynamicVRAM (alloc_fn/free_fn, cudaMallocAsync/cudaFreeAsync, and VBAR model weight paging are all unchanged) As far as I understand, VRAM pressure is still detected via cuMemGetInfo polling in budget_deficit() --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:24:15 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-aimdo#66
No description provided.