28 Commits

Author SHA1 Message Date
Adam Basfop Cavendish
032361a177 chore(example): add nvvm library path to LD_LIBRARY_PATH and add back the add example in CI (#190)
When linking `libnvvm.so.4` into `librustc_codegen_nvvm.so` shared
library via the `cust_raw` package, we specified the following
parameters in the `build.rs`:

- cargo::rustc-link-search=native=xxx
- cargo::rustc-link-lib=dylib=nvvm

According to the [Cargo documentation](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-search),
the path we added to the `rustc-link-search` parameter is not further
populated to the `LD_LIBRARY_PATH` for search by the transitive
dependencies.

> These paths are also added to the dynamic library search path
> environment variable if they are within the OUT_DIR.

The behavior is intended to be limited to the OUT_DIR so the
`libnvvm.so.4`, which lives as a part of the CUDA SDK, is excluded.
Therefore, we must add it to the LD_LIBRARY_PATH manually in our
container build stage.
2025-04-05 13:26:45 -07:00
Adam Basfop Cavendish
9856aad6d3 feat(ci): Split Linux CI workflow and add container images pipeline (#188)
Added a new workflow, container_images.yml, to automate building and
pushing CI container images to GitHub Container Registry, ensuring
consistent environments for CI runs across Linux distributions.

Added a dedicated CI workflow for Linux to streamline testing across
multiple CUDA and OS configurations. It reuses the images built from
container_images.yml workflow to avoid installing CUDA toolkits every
time to save time.

Key changes:
- Matrix configurations for Ubuntu 22/24, RockyLinux 9 with CUDA 12.8.1
- Dockerfiles updated with required dependencies (clang, CUDA
  toolchains, etc.) to support bindgen and build examples.
- Removed redundant CI steps from `rust.yml` now handled in
  `ci_linux.yml`
2025-04-03 17:30:16 -07:00
Jorge Ortega
0f9bc16102 chore(ci) Use CUDA network installer and specify sub-packages. (#189)
The network installer is a smaller initial download, which will only
download the require packages to install. This should reduce the install
times on Windows CI.
2025-04-03 16:31:41 -07:00
Adam Basfop Cavendish
b85d9ca136 refactor(cust_raw): consolidate CUDA, cuDNN, OptiX bindgen and remove find_cuda_helper (#181)
1. Consolidation of bindgen related "*-sys" packages
  - Remove the common dependency of `find_cuda_helper`. Use the cargo
    metadata mechanism instead.
  - Merged all CUDA bindgen-generated code into the cust_raw crate for
    simplicity and maintainability.
  - Add CUDA Runtime API bindgen support.
2. cuDNN and OptiX Integration
  - Split cudnn into cudnn (high-level API) and cudnn-sys (low-level
    bindgens) for better abstraction.
  - Split optix into optix (high-level API) and optix-sys (low-level
    bindgens) for better abstraction.
3. CUDA 12+ Support
  - Updated cust to support CUDA versions >= 12.
  - Added compatibility for CUDA 12.3+ graph API changes:
    - Renamed cuGraphKernelNodeGetParams →
      cuGraphKernelNodeGetParams_v2.
    - Enabled conditional node support for CUDA >= 12.3.
4. Temporarily disable cuDNN in CI
    - Windows CI pipelines have no cuDNN support yet.

Co-authored-by: Jorge Ortega <jorge-ortega@outlook.com>
2025-04-02 16:57:40 -07:00
Christian Legnitto
a21f4da628 Turn off local CUDA install cache 2025-03-19 15:09:47 -04:00
Christian Legnitto
1a663aadc3 Add CUDA 12 to CI (#168) 2025-03-17 22:19:32 -04:00
Christian Legnitto
9b07099e37 Output CUDA files in workflow (#161)
This will help debug.
2025-03-15 15:15:47 -04:00
Christian Legnitto
450d16c0cc Run CI on main (#148) 2025-03-07 15:21:02 -04:00
Christian Legnitto
ab4af169b0 Fix cuda toolkit installation in CI (#147) 2025-03-07 15:08:37 -04:00
Anders Langlands
5f5e451e59 Feat: Tons of cust changes and start of OptiX (hardware rt) work
* wip

* bootstrap enough optix to get ex02 working

* Add example 03

Generate an animated pattern in the raygen and display it in a window using glfw

* add logging callback

* remove ustr

* Manually create OptixShaderBindingTable

field-by-field instead of transmute

* Switch Module and Pipeline methods to their structs

Instead of having them on DeviceContext

* Switch Module, Pipeline, ProgramGroup methods to their structs

Instead of having them on DeviceContext

* Refactor: remove dead imports

* derive DeviceCopy

* typo

* Better error message

* Move destroy to Drop impl

* typo

* rename OptixContext to DeviceContext

* Make launch params variable name optional

* Remove Clone from Module and ProgramGroup

* Make log callback safe

User catch_unwind to guard against panic in C. Remove note about lifetime of
closure since it's 'static anyway. Have set_log_callback return a Result instead
of panicking on error.

* add wip glam support

* dont panic in drop

* Rework DevicePointer on top of CUdeviceptr

This switches out *T for CUdeviceptr in DevicePointer. This has the
knock-on effect of removing a lot of "pretend we're a CPU pointer" stuff
from downstream types like DeviceSlice.

* wip

* bootstrap enough optix to get ex02 working

* Add example 03

Generate an animated pattern in the raygen and display it in a window using glfw

* add logging callback

* remove ustr

* Manually create OptixShaderBindingTable

field-by-field instead of transmute

* Switch Module and Pipeline methods to their structs

Instead of having them on DeviceContext

* Switch Module, Pipeline, ProgramGroup methods to their structs

Instead of having them on DeviceContext

* Refactor: remove dead imports

* derive DeviceCopy

* typo

* Better error message

* Move destroy to Drop impl

* typo

* rename OptixContext to DeviceContext

* Make launch params variable name optional

* Remove Clone from Module and ProgramGroup

* Make log callback safe

User catch_unwind to guard against panic in C. Remove note about lifetime of
closure since it's 'static anyway. Have set_log_callback return a Result instead
of panicking on error.

* add wip glam support

* dont panic in drop

* wip accel support

* Add accel wip

Enough acceleration structure stuff to get example 04 running, and
rebasing on top of deviceptr branch

* Rework acceleration structure stuff

Provide simple internally allocating API for Accel, but also allow
creating one from raw parts to let user handle memory allocation.
Original API kept as free functions and marked unsafe.

Implement all build input types.

Add mint support to cust and optix.

* add lifetime bound on Instance to referenced Accel

* Have DeviceCopy impl for lifetime markers use null type

* Add unsaafe from_handle ctor

* Add update for DynamicAccel

* Hash build inputs to ensure update is sound

* Add relocation info

* Add remaning DeviceContext methods

* Correct docstrings

* Add doc comments

* Add a prelude

* Own the geometry flags array

* Add prelude

* own the geometry flags array and add support for pre_transform

* Fill out context and add some module docs

* Add some module docs

* Update to latest library changes

* Add more docs

* Remove mut requirement for getting pointer

* Add a simple memcpy_htod wrapper

* Add back pointer offset methods

* Big structure reorg and documentation push

- Reorganized the module structure to something less fragmented. Modules
  are longer but more cohesive.
- Integrated the optix programming guide inline into the module
  documentation.

You need to build the docs with:
RUSTDOCFLAGS="--html-in-header katex-header.html"  cargo doc --no-deps

To see the equations (this is done automatically on docs.rs)

* Wrap SBT properly

* Rename transform types

* Simplify AccelBuildOptions creation

Just take a build flags and move everything else to builders

* Hide programming guide in details tags

* Adapt to latest changes

* Fix toolchain version

* Fix name of DeviceContext

* first optix rust test

* Set ALLOW_COMPACTION in build options

* Use find_cuda_helper to get cuda path

* Handle differering enum representation on windows and linux

* Add DeviceVariable

* Add DeviceMemory trait

Abstracts over different device storage representations

* Add mem_get_info

* Add external memory

* Add a few more types to prelude

* Add more types

* Rework on top of new DeviceVariable

* first optix rust test

* tweak build

* update to latest optix changes

* Split DeviceCopy into cust_core

* update to latest optix changes

* trying to get print working

* tweak test kernel

* stop llvm optimizing out LaunchParams

* Chore: update cargo.toml dep versions

* Feat: second pass for fixing conflicts

* Feat: delete as_ptr and as_mut_ptr on DeviceSlice

* Revert "Feat: delete as_ptr and as_mut_ptr on DeviceSlice"

This reverts commit e858fdcaf3.

* Feat: experiment with deleting as_ptr and as_mut_ptr

* Fix issues and warnings

* Chore: run formatting

* Chore: exclude examples from building in CI

* Feat: update changelog with changes, misc changes before merge

Co-authored-by: rdambrosio <rdambrosio016@gmail.com>
2022-01-21 18:08:05 -05:00
rdambrosio
f79889a1db Chore: remove random \ before cargo in CI 2021-11-30 01:05:55 -05:00
rdambrosio
54c84f4931 Fix: hopefully fix CI 2021-11-30 00:52:38 -05:00
rdambrosio
8465f45605 Chore: dont use env var for exclusions 2021-11-26 13:41:04 -05:00
rdambrosio
3ab9b7e5b1 Fix: fix bswap, add changelog, and fix CI arg passing 2021-11-26 12:42:56 -05:00
rdambrosio
46d5b5e409 Chore: exclude libs in clippy and fix workspace dir 2021-11-26 02:30:08 -05:00
rdambrosio
41af20d5db Chore: temporarily exclude add from CI 2021-11-26 02:16:07 -05:00
rdambrosio
b2ea96250d Chore: try linking llvm statically 2021-11-26 01:12:04 -05:00
rdambrosio
3819b89bc6 Chore: llvm 7 not llvm 7.1.0 package 2021-11-26 00:59:15 -05:00
rdambrosio
d4b2d7baf9 Chore: try simlinking llvm-config-7.1 2021-11-26 00:54:39 -05:00
rdambrosio
d7c8a6da0e Chore: apparently llvm script doesnt support 7 2021-11-26 00:47:00 -05:00
rdambrosio
e52797d545 Chore: download LLVM for CI on linux 2021-11-26 00:35:55 -05:00
rdambrosio
74a5747fbc Chore: ignore optix crates in CI and add back removed feature 2021-11-25 23:27:06 -05:00
rdambrosio
e838e6a252 Chore: export env through GITHUB_ENV 2021-11-25 21:55:48 -05:00
rdambrosio
4fc2486441 Chore: add script to download optix headers in ci 2021-11-25 21:36:03 -05:00
rdambrosio
4ac952dc78 Chore: force installation of rust-toolchain in CI 2021-11-24 18:12:30 -05:00
rdambrosio
2ce5a36d18 Chore: use 11.2.2 instead of 11.5.0 for CUDA CI 2021-11-24 17:49:56 -05:00
rdambrosio
555c53123a Feat: rename Dslice to DeviceSlice, fix clippy errs, start adding CI 2021-11-24 17:48:33 -05:00
Amadeusine
7dcf6cff5f Docs: Build guide as mdbook (#5)
* Add mdbook action

* Fix mdbook output directory
2021-11-22 22:06:28 -05:00