Hello,
(It's my first time writing an issue, maybe i didn't express well my problem. Please be patient ! )
I install and build nvdiffrast (no error)
build_log.txt
from source in a Python 3.12 environment with CUDA 12.8 and PyTorch 2.9.1+cu128. But when I tried to run sample script from
nvdiffrast/samples/torch/triangle.py
for example, the execution failed.
Here the output :
Traceback (most recent call last):
File "/home/mao/nvdiffrast/samples/torch/triangle.py", line 20, in <module>
glctx = dr.RasterizeCudaContext()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mao/nvdiffrast/.venv/lib/python3.12/site-packages/nvdiffrast/torch/ops.py", line 67, in __init__
self.cpp_wrapper = _nvdiffrast_c.RasterizeCRStateWrapper(cuda_device_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Cuda error: 209[cudaFuncGetAttributes(&attr, (void*)fineRasterKernel);]
I tried to replace dr.RasterizeCudaContext()by dr.RasterizeGLConstext(), but I ended up with a similar error :
$ python3 triangle.py
/home/mao/nvdiffrast/samples/torch/triangle.py:17: DeprecationWarning: RasterizeGLContext has been deprecated and uses RasterizeCudaContext internally
glctx = dr.RasterizeGLContext()
Traceback (most recent call last):
File "/home/mao/nvdiffrast/samples/torch/triangle.py", line 17, in <module>
glctx = dr.RasterizeGLContext()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mao/nvdiffrast/.venv/lib/python3.12/site-packages/nvdiffrast/torch/ops.py", line 553, in __init__
super().__init__(device=device)
File "/home/mao/nvdiffrast/.venv/lib/python3.12/site-packages/nvdiffrast/torch/ops.py", line 67, in __init__
self.cpp_wrapper = _nvdiffrast_c.RasterizeCRStateWrapper(cuda_device_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Cuda error: 209[cudaFuncGetAttributes(&attr, (void*)fineRasterKernel);]
Here some more additional informations about what I did for the installation :
-
I followed the steps installation from "Custom install on Linux" https://nvlabs.github.io/nvdiffrast/#installation
-
(maybe useless info in that specific case) When I tried to this command pip install setuptools wheel ninja
it failed :
$pip install setuptools wheel ninja
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
so I created virtual environment, with the following steps :
$python3 -m venv .venv
$source .venv/bin/activate
Then i was been able to follow the rest of nvdiffrast' steps. At the end with pip install . --no-build-isolation I encounter no error like I said in the beginning of my post. I don't think the virtual environment plays a role in this problem.
Infos about versions and materials :
- Driver version
$nvidia-smi
Tue May 12 15:21:14 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.58.03 Driver Version: 595.58.03 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA RTX PRO 1000 Blac... Off | 00000000:01:00.0 Off | N/A |
| N/A 39C P4 7W / 35W | 14MiB / 8151MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1208 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------------------+
- nvcc version
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Wed_Jan_15_19:20:09_PST_2025
Cuda compilation tools, release 12.8, V12.8.61
Build cuda_12.8.r12.8/compiler.35404655_0
- Python version
Python: 3.12.3
PyTorch: 2.9.1+cu128
CUDA interne à Torch: 12.8
CUDNN: 91002
I tried to look up the other issues and I asked to AI (Gemini and Perplexity), but I'm having difficulty. Thank for your time and help !
Hello,
(It's my first time writing an issue, maybe i didn't express well my problem. Please be patient ! )
I install and build nvdiffrast (no error)
build_log.txt
from source in a Python 3.12 environment with CUDA 12.8 and PyTorch 2.9.1+cu128. But when I tried to run sample script from
for example, the execution failed.
Here the output :
I tried to replace
dr.RasterizeCudaContext()bydr.RasterizeGLConstext(), but I ended up with a similar error :Here some more additional informations about what I did for the installation :
I followed the steps installation from "Custom install on Linux" https://nvlabs.github.io/nvdiffrast/#installation
(maybe useless info in that specific case) When I tried to this command pip install setuptools wheel ninja
it failed :
so I created virtual environment, with the following steps :
$python3 -m venv .venv
$source .venv/bin/activate
Then i was been able to follow the rest of nvdiffrast' steps. At the end with
pip install . --no-build-isolationI encounter no error like I said in the beginning of my post. I don't think the virtual environment plays a role in this problem.Infos about versions and materials :
I tried to look up the other issues and I asked to AI (Gemini and Perplexity), but I'm having difficulty. Thank for your time and help !