Page 1 of 1

CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 9:33 am
by rrubberr
When attempting to use LuxCore 2.4 CUDA rendering, it produced the error "CUDA_ERROR_INVALID_PTX: a PTX JIT compilation failed" :? I received this error while using NVIDIA Quadro driver version 392.58, which although not the "biggest number" driver, it is worth noting that this is a current driver, and was released as part of the NVIDIA Quadro 390 driver branch on June 24, 2020.

This driver, according to the release notes, includes CUDA 9.1, which is perhaps not supported by LuxCore 2.4 :?: Upon switching to a driver from the 418 branch which includes CUDA 10.1, this issue was resolved. This error can be resolved by switching to a different Quadro driver branch, however, I could not find a CUDA requirement listed on the LuxCore page or the 2.4 release notes. Both drivers were tested on a clean installation of Windows with Blender 2.83. If this is a requirement, it may be helpful to add it to the website (unless it is already listed and I just cannot find it).
Error printed in the Blender console.
Error printed in the Blender console.
Here are the release notes for the two driver versions:
http://us.download.nvidia.com/Windows/Q ... -notes.pdf
http://us.download.nvidia.com/Windows/Q ... -notes.pdf

Re: CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 9:52 am
by Dade
rrubberr wrote: Mon Jul 27, 2020 9:33 am This driver, according to the release notes, includes CUDA 9.1, which is perhaps not supported by LuxCore 2.4 :?:
Yes, v2.4 was developed with CUDA 10 and v2.5 is developed with CUDA 11 (required by Optix v7.1).

Re: CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 10:11 am
by B.Y.O.B.
I have added a note about the required CUDA version to the "new in v2.4" page.
It might also be a good idea to throw a runtime error in LuxCore with a clear error message in case a driver with lower CUDA version is used for GPU rendering (if it's possible to detect this).

Re: CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 10:41 am
by Dade
B.Y.O.B. wrote: Mon Jul 27, 2020 10:11 am It might also be a good idea to throw a runtime error in LuxCore with a clear error message in case a driver with lower CUDA version is used for GPU rendering (if it's possible to detect this).
v2.4, as far as I know, works with any (not prehistoric) CUDA version. The problem is related to the NVRTC (i.e. the CUDA runtime compiler).

We had to include the NVRTC with Lux because it is not included with NVIDIA driver. We included the one in CUDA 10. The above problem arise because the compiler generates PTX for CUDA 10 (or better) while the driver was supporting only CUDA 9.

If you replace NVRTC DLL included in Lux with the one in CUDA 9 SDK, everything should work fine.

I may be able to check the PTX version supported by the drivers but I'm not sure.

Re: CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 11:03 am
by rrubberr
Dade wrote: Mon Jul 27, 2020 9:52 amYes, v2.4 was developed with CUDA 10 and v2.5 is developed with CUDA 11 (required by Optix v7.1).
This makes sense, however, at the time of writing this, the latest Quadro drivers for Windows 7 and Windows 8.1 (including server versions) is version 440, which supports only CUDA 10.2 :!: Will the same fix of replacing NVRTC work with LuxCore 2.5? If not, does installing the CUDA 11 toolkit update the system CUDA version? If not, I can simply use OpenCL rendering until an update is released by NVIDIA :D
B.Y.O.B. wrote: Mon Jul 27, 2020 10:11 amI have added a note about the required CUDA version to the "new in v2.4" page.
Good idea, thank you!

Re: CUDA_ERROR_INVALID_PTX

Posted: Mon Jul 27, 2020 11:21 am
by Dade
rrubberr wrote: Mon Jul 27, 2020 11:03 am Will the same fix of replacing NVRTC work with LuxCore 2.5?
It should.