Skip to content

GEM handles return 0 #270

@YusufKhan-gamedev

Description

@YusufKhan-gamedev

NVIDIA Open GPU Kernel Modules Version

ce3d74f

Does this happen with the proprietary driver (of the same version) as well?

I cannot test this

Operating System and Version

Fedora release 36 (Thirty Six)

Kernel Release

Linux fedora 5.17.9-300.fc36.x86_64 #1 SMP PREEMPT Wed May 18 15:08:23 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Hardware: GPU

Its a RTX 2060 from GIGABYTE, I am not going to install the proprietary tool that is suggested

Describe the bug

GEM handles are 0

To Reproduce

Run this program with my libdrm nvidia branch

#include <xf86drm.h>
#include <nvidia.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <fcntl.h>

int main () {
	int fd = open("/dev/dri/card0", O_RDWR | O_CREAT);
        perror("open");
        printf("%i", fd);
        struct nvidia_gem_alloc_nvkms_memory_params params;
        params.memory_size = 1;
        nvidia_gem_alloc_nvkms_memory(fd, params);
        printf("\n%u", params.handle);
        return nvidia_get_gem_map_offset(fd, params.handle);
        /* return params.handle; */
}

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

No proprietary userland

More Info


yusufkhan@fedora ~/.l/s/drm (nvidia) [0|1]> dmesg | grep nvidia
[    5.295301] nvidia-gpu 0000:01:00.3: i2c timeout error e0000000
[  210.845517] nvidia: loading out-of-tree module taints kernel.
[  210.846385] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[  210.850349] nvidia: unknown parameter 'modeset' ignored
[  210.851051] nvidia-nvlink: Nvlink Core is being initialized, major device number 511
[  210.851609] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[  210.899001] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for x86_64  515.43.04  Release Build  (root@fedora)  Sat May 28 11:40:16 AM EDT 2022
[  210.900289] nvidia_drm: unknown parameter 'NVreg_RmMsg' ignored
[  210.900678] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[  211.068273] [drm:nv_drm_load [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to allocate NvKmsKapiDevice
[  211.068399] [drm:nv_drm_probe_devices [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to register device
[  211.068473] RIP: 0010:GrabOwnership+0x4/0x40 [nvidia_modeset]
[  211.068518]  ? nv_drm_master_set+0x1e/0x40 [nvidia_drm]
[  211.068555] Modules linked in: nvidia_drm(OE) nvidia_modeset(OE) nvidia(OE) rfcomm snd_seq_dummy snd_hrtimer nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink qrtr bnep sunrpc vfat fat snd_sof_pci_intel_cnl snd_sof_intel_hda_common soundwire_intel intel_rapl_msr intel_rapl_common iwlmvm soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof soundwire_bus mac80211 intel_tcc_cooling snd_soc_skl x86_pkg_temp_thermal intel_powerclamp snd_soc_hdac_hda coretemp libarc4 snd_hda_ext_core kvm_intel mei_pxp snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_acpi_intel_match iTCO_wdt ucsi_ccg intel_pmc_bxt mei_hdcp ee1004 iTCO_vendor_support typec_ucsi snd_soc_acpi typec kvm snd_hda_codec_realtek snd_hda_codec_generic snd_soc_core iwlwifi irqbypass
[  211.068582]  ledtrig_audio snd_hda_codec_hdmi snd_compress ac97_bus snd_pcm_dmaengine iwlmei snd_hda_intel snd_intel_dspcfg rapl btusb intel_cstate snd_intel_sdw_acpi intel_uncore cfg80211 snd_hda_codec btrtl pcspkr btbcm snd_hda_core btintel i2c_i801 intel_wmi_thunderbolt wmi_bmof mei_me snd_seq btmtk snd_hwdep i2c_smbus bluetooth mei snd_seq_device snd_pcm ecdh_generic joydev rfkill snd_timer snd i2c_nvidia_gpu soundcore intel_pch_thermal acpi_pad acpi_tad zram hid_logitech_hidpp mxm_wmi crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel wmi video hid_logitech_dj ip6_tables ip_tables ipmi_devintf ipmi_msghandler fuse
[  211.068607] RIP: 0010:GrabOwnership+0x4/0x40 [nvidia_modeset]
[  211.082513] nvidia_uvm: unknown parameter 'NVreg_RmMsg' ignored
[  211.083931] nvidia-uvm: Loaded the UVM driver, major device number 509.
[  280.482711] nvidia_peermem: module license 'Linux-OpenIB' taints kernel.

Issue doesnt exist on Windows(ie. it allows for 3d acceleration), nouveau works

Related to #116

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions