** Additional Installation Instructions ** __________________ Ubuntu 22.04 and more _________________ To compile nvBowtie, it is essential to install the CUDA development suite. You can find many pages explaining how to install cuda on your linux distribution. If you're using Ubuntu 24.04 or higher, you can also use the installation_cuda.sh script located in the 'inst/scripts' directory. This script will erase all traces of drivers and older versions of cuda before you start. This can be useful if you are unable to install cuda correctly after several attempts. In addition, this script also offers to install the default version of your distribution, or to install the latest version (12.8) if you're having problems with the older version. Use the default version first. An additional script, called check_requirements.sh, verifies your installation and determines if everything went smoothly. Architecture handling (auto-detection + PTX fallback): By default nvBowtie auto-detects the GPU(s) on the build host via nvidia-smi and compiles native SASS for each detected compute capability, PLUS a PTX JIT fallback for the oldest architecture supported by the installed CUDA toolkit. The resulting fatbin therefore runs natively on the build GPU and via driver JIT on any other GPU at or above that floor, so a package built on one card works across varied GPUs. Floor (oldest target) by toolkit: CUDA 13.x -> sm_75 (Turing); CUDA <= 12.x -> sm_70 (Volta). Note: CUDA 13 removed Pascal/Maxwell/Volta, so nvcc 13 rejects sm_60/sm_70 targets outright. To override auto-detection, set CMAKE_CUDA_ARCHITECTURES when configuring src/nvbio, e.g.: cmake -DCMAKE_CUDA_ARCHITECTURES="120;75-virtual" .. (native sm_120 SASS + compute_75 PTX JIT fallback). Keep at least one "-virtual"/PTX entry for portability. Refer to the NVIDIA compatibility guide for matching cards: (https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards). It is also necessary to install the thrust and cub libraries by typing in a terminal : sudo apt install libthrust-dev libcub-dev No GPU needed to build, one needed to run: Compiling and checking the package work on a machine without any GPU (CI runner, r-universe, cluster login node, container). configure only fails when something that genuinely blocks compilation is missing (nvcc, libthrust-dev, libcub-dev, cmake); driver and device problems are reported as information. When nvidia-smi cannot report a compute capability, configure falls back to the oldest architecture the installed toolkit supports (sm_75 with CUDA 13, sm_70 with CUDA 12) plus a PTX JIT fallback, which is also what you want for a package built on a GPU-less host. Running nvBowtie / nvBWT / nvbio_tests does require a GPU. The vignette, the Rd examples and the unit test all check for a usable device first and skip -- printing how much device memory they found -- instead of failing the check when the card is missing or too full for the run: vignette, and the nvBWT() / nvBowtie() examples require 2048 MB of free device memory nvbio_tests(), unit test and its example require 4096 MB of free device memory The floors live in R/gpu.R (gpu_min_free_mb) and are heuristics, not measured peaks: a CUDA context alone takes a few hundred MB, and nvbio-test cudaMallocs up to 1 GB before running its alignment test. On a shared builder another tenant can still claim the memory while a run is in progress, so these floors remove the common false failure, they do not reserve memory. Override them without reinstalling: options(RbowtieCuda.minFreeMemMB = 8192) Host compiler (nvcc vs g++): nvcc and the system C++ compiler have to agree on a supported version. If the default host compiler is rejected -- typical case: CUDA 12.4 from the distribution against GCC 15 on a recent Ubuntu -- configure probes g++-22 down to g++-9 and sets CMAKE_CUDA_HOST_COMPILER to the first one that compiles a trivial .cu, then reports the choice in the build log. Force it with: cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-13 .. and, if the link step then complains about a mismatch, pass the same compiler for the host code: cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-13 -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-13 .. Build memory and parallelism: The CUDA translation units are the memory-hungry part of the build: each nvcc job peaks at a few GB of host RAM on the thrust/cub-heavy files, so a runner with 16 GB and 8 concurrent nvcc processes gets OOM-killed. src/Makefile derives its job count as min(nproc, MemAvailable / NVBIO_MEM_PER_JOB_KB, job count requested by the caller) which keeps a 16 GB / 4 vCPU runner alive while still honouring an explicit -j as a ceiling. MAKEFLAGS is never assigned, so the builder's own parallelism and jobserver are respected. Knobs: NVBIO_MEM_PER_JOB_KB=3000000 host RAM budgeted per nvcc job, in kB (default 3 GB) NVBIO_JOBS=8 force the number of parallel jobs R CMD INSTALL --no-configure ... / make -j4 normal ways to lower parallelism 3 GB per job is a conservative estimate, not a measurement. To calibrate it on your own machine, build the single heaviest translation unit and read its peak RSS: cd src/nvbio/build /usr/bin/time -v make nvBowtie/CMakeFiles/nvBowtie.dir/bowtie2/cuda/aligner_best_approx_paired_wfa.cu.o -> "Maximum resident set size (kbytes)" _____________________ Windows __________________ ** Cuda installation on Windows ** You must have a developer account on the NVidia website (https://developer.nvidia.com). If you don’t already have one, you will need to create an account. Next, download the CUDA Toolkit 11.8, which is available here: https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64 For detailed instructions on installing CUDA on Windows, refer to this guide: https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html Note that RbowtieCuda is compatible with Cuda versions >= 10. ** Installing RTools on Windows ** RTools must also be installed on Windows. You can download it here: https://cran.r-project.org/bin/windows/Rtools/ ** Installing Build Tools for Visual Studio 2022 ** The Visual Studio Build Tools are required and can be downloaded here: https://visualstudio.microsoft.com/en/downloads/ ** Note: Compilation on Windows ** The package compilation process on Windows can be lengthy (up to 15 minutes). ________________ Recommended runtime options _________________ For paired-end FASTQ workloads, we recommend running nvBowtie with: --cache-writes --batch-size 2048 This overlaps output writing with GPU compute through a dedicated write thread. Measured on a mouse dataset (5M read pairs, GRCm39 index, RTX 5070, SATA SSD): total wall time drops from ~36 s to ~28 s (compute ~20 s + index load ~4 s + I/O). Notes: - Index load is ~4 s per call (bwt/rbwt/occ/ssa); the occurrence tables are built on the fly (~1.3 s each). Reusing a warm OS page cache between calls keeps this low. - SAM output for 5M pairs is ~3.4 GB; plan disk space accordingly. Writing to tmpfs (e.g. /tmp) avoids the write tax when the SAM file is consumed immediately downstream. - BAM output (-S out.bam) is supported and bit-exact with the SAM records, but currently slower overall (~41 s vs ~28 s on the same run): BGZF compression happens inline instead of on the shared write thread. Prefer SAM unless BAM size is the bottleneck.